Re: [PHP-DB] Problem, please help!

2004-03-21 Thread John
> try writing it like
> $sql = "UPDATE round1
> SET game1='" . $game1 . "',
> game2='" . $game2 . "',
> game3='" . $game3 . "',
> game4='" . $game4 . "',
> game5='" . $game2 . "',
> game6='" . $game6 . "',
> game7='" . $game7 . "',
> game8='" . $game8 . "',
> misc='y'
> WHERE username = '" . $sidarray[0] . "'";
> 
> matt



Single quotes around variables within a double quoted statement works.

John

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Problem, please help!

2004-03-20 Thread php
it looks like the use of double and single quotes could be at fault

try writing it like
$sql = "UPDATE round1
SET game1='" . $game1 . "',
game2='" . $game2 . "',
game3='" . $game3 . "',
game4='" . $game4 . "',
game5='" . $game2 . "',
game6='" . $game6 . "',
game7='" . $game7 . "',
game8='" . $game8 . "',
misc='y'
WHERE username = '" . $sidarray[0] . "'";

matt

Quoting JeRRy <[EMAIL PROTECTED]>:

> > > 
> > >
> > > $sql = "UPDATE round1 SET game1='$game1' ,
> > > game2='$game2' , game3='$game3' , game4='$game4'
> > > , game5='$game5' , game6='$game6' , game7='$game7'
> > ,
> > > game8='$game8' , misc='y'
> > > WHERE username= \"$sidarray[0]\"";
> > 
> > 
> > This only updates an existing record, where the
> > username is equal to 
> > $sidarray[0]. Don't expect it to insert new data.
> 
> Yes tried both, insert and update.  Both fails. 
> Including a 'or die' statement in the mysql connection
> but does not return it can't connect.  So it must be
> connecting just not posting. :(  Any other problems
> that could cause this?
> 
> > 
> > > Okay it output on the php page fine but won't save
> > to
> > > db, anyone know why?
> > 
> > Secondly, please put a little effort in writing
> > quality code and markup 
> > before you post it here.  is really ugly...
> 
> I stated in my first post the code was messy ... Think
> messy and ugly match in some way.  It's just a quick
> job that worked fine last year but does not wanna work
> now. :(  I must of changed something before I ended my
> work last year on it to make it not work.  I'll keep
> trying some stuff.  Think it might have something to
> do with my cookie.php file as I require sidarray[0]
> which is fed from that.
> 
> J
> 
> Find local movie times and trailers on Yahoo! Movies.
> http://au.movies.yahoo.com
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Problem, please help!

2004-03-20 Thread JeRRy
> > 
> >
> > $sql = "UPDATE round1 SET game1='$game1' ,
> > game2='$game2' , game3='$game3' , game4='$game4'
> > , game5='$game5' , game6='$game6' , game7='$game7'
> ,
> > game8='$game8' , misc='y'
> > WHERE username= \"$sidarray[0]\"";
> 
> 
> This only updates an existing record, where the
> username is equal to 
> $sidarray[0]. Don't expect it to insert new data.

Yes tried both, insert and update.  Both fails. 
Including a 'or die' statement in the mysql connection
but does not return it can't connect.  So it must be
connecting just not posting. :(  Any other problems
that could cause this?

> 
> > Okay it output on the php page fine but won't save
> to
> > db, anyone know why?
> 
> Secondly, please put a little effort in writing
> quality code and markup 
> before you post it here.  is really ugly...

I stated in my first post the code was messy ... Think
messy and ugly match in some way.  It's just a quick
job that worked fine last year but does not wanna work
now. :(  I must of changed something before I ended my
work last year on it to make it not work.  I'll keep
trying some stuff.  Think it might have something to
do with my cookie.php file as I require sidarray[0]
which is fed from that.

J

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Problem, please help!

2004-03-20 Thread Filip de Waard
On Mar 21, 2004, at 3:44 AM, JeRRy wrote:
Hi,

I have not used this site in a while and have a
problem.  I can't get anything to save to the
database. :(  Not sure what is wrong, need a fix fast
as the site needs to be active in a few days by the
latest so hopefully I can get help in that time.  The
code is a bit messy I know but here goes:


$sql = "UPDATE round1 SET game1='$game1' ,
game2='$game2' , game3='$game3' , game4='$game4'
, game5='$game5' , game6='$game6' , game7='$game7' ,
game8='$game8' , misc='y'
WHERE username= \"$sidarray[0]\"";


This only updates an existing record, where the username is equal to 
$sidarray[0]. Don't expect it to insert new data.

Okay it output on the php page fine but won't save to
db, anyone know why?
Secondly, please put a little effort in writing quality code and markup 
before you post it here.  is really ugly...

Regards,

Filip de Waard

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php