[PHP] SQL Query syntax error... Help?

2001-04-15 Thread Scott VanCaster

I've only been trying to learn this stuff for a few days and thought I was
on a roll, but now have run into a problem I don't get at all.  In my script
I have the following sql query and am receiving the following error when it
executes "You have an error in your SQL syntax near '' at line 1."

Any idea what my problem is?  I removed the WHERE id=$id and it works, but
updates every record of course :(

I'm lost here.  Thanks for any help.

$sql ="UPDATE members SET ".
  "name='$name', ".
  "email='$email', ".
  "icq='$icq', ".
  "password='$password', ".
  "loginid='$loginid', ".
  "countryid='$countryid', ".
  "gtlogin='$gtlogin', ".
  "gtpass='$gtpass', ".
  "swirvelogin='$swirvelogin', ".
  "swirvepass='$swirvepass' ".
  "WHERE id=$id" ;



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL Query syntax error... Help?

2001-04-15 Thread Scott VanCaster

id is the primary key for the table.  If I add echo ($id); before the query
it echos a 15, which is correct.  Well, it's the right id for the test
person I'm logged into the site as anyway.  I'm missing something here :)


"Augusto Cesar Castoldi" [EMAIL PROTECTED] wrote in message
Pine.A41.4.32.0104151924060.11846-10@marte">news:Pine.A41.4.32.0104151924060.11846-10@marte...
 What do you have in the id variable?

 It's contents can be the problem.

 regards,

 Augusto Cesar Castoldi

 On Sun, 15 Apr 2001, Scott VanCaster wrote:

  I've only been trying to learn this stuff for a few days and thought I
was
  on a roll, but now have run into a problem I don't get at all.  In my
script
  I have the following sql query and am receiving the following error when
it
  executes "You have an error in your SQL syntax near '' at line 1."
 
  Any idea what my problem is?  I removed the WHERE id=$id and it works,
but
  updates every record of course :(
 
  I'm lost here.  Thanks for any help.
 
  $sql ="UPDATE members SET ".
"name='$name', ".
"email='$email', ".
"icq='$icq', ".
"password='$password', ".
"loginid='$loginid', ".
"countryid='$countryid', ".
"gtlogin='$gtlogin', ".
"gtpass='$gtpass', ".
"swirvelogin='$swirvelogin', ".
"swirvepass='$swirvepass' ".
"WHERE id=$id" ;
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL Query syntax error... Help?

2001-04-15 Thread Scott VanCaster

I "think" I tried that.  Let me go try that again to be sure.

Oh, and what's STDOUT ?  I'm just getting started here and haven't even seen
that yet :)

I can't believe how fast the responses are either.  Thanks to all for
helping others out so quickly :)

"Felix Kronlage" [EMAIL PROTECTED] wrote in message
20010415232649.A11407@mad">news:20010415232649.A11407@mad...
 On Sun, Apr 15, 2001 at 04:20:07PM -0500, Scott VanCaster wrote:

  Any idea what my problem is?  I removed the WHERE id=$id and it works,
but
  updates every record of course :(

 Have you tried putting the $id in quotes too?

 | WHERE = '$id'

 if that doesn't help, print the sql-statement to STDOUT (e.g. probably to
the
 browser) and take a look at it, that way it is easier to see where the
 error is.

 -fkr
 --
 gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0
   |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
   |all your base are belong to us  |  shame on me  | fkr@IRCnet |


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL Query syntax error... Help?

2001-04-15 Thread Scott VanCaster

I changed $id to '$id'

No more error, but nothing updates.  Assuming it's because with the single
quotes nothing in the table matches?

"Felix Kronlage" [EMAIL PROTECTED] wrote in message
20010415232649.A11407@mad">news:20010415232649.A11407@mad...
 On Sun, Apr 15, 2001 at 04:20:07PM -0500, Scott VanCaster wrote:

  Any idea what my problem is?  I removed the WHERE id=$id and it works,
but
  updates every record of course :(

 Have you tried putting the $id in quotes too?

 | WHERE = '$id'

 if that doesn't help, print the sql-statement to STDOUT (e.g. probably to
the
 browser) and take a look at it, that way it is easier to see where the
 error is.

 -fkr
 --
 gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0
   |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
   |all your base are belong to us  |  shame on me  | fkr@IRCnet |


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL Query syntax error... Help?

2001-04-15 Thread Scott VanCaster

Well, I added the echo($id); back in and am just getting $id printed, so it
looks like I have another problem :(

Now to see if I can find it and figure it out.


""Scott VanCaster"" [EMAIL PROTECTED] wrote in message
9bd3pv$qbd$[EMAIL PROTECTED]">news:9bd3pv$qbd$[EMAIL PROTECTED]...
 id is the primary key for the table.  If I add echo ($id); before the
query
 it echos a 15, which is correct.  Well, it's the right id for the test
 person I'm logged into the site as anyway.  I'm missing something here :)


 "Augusto Cesar Castoldi" [EMAIL PROTECTED] wrote in message
 Pine.A41.4.32.0104151924060.11846-10@marte">news:Pine.A41.4.32.0104151924060.11846-10@marte...
  What do you have in the id variable?
 
  It's contents can be the problem.
 
  regards,
 
  Augusto Cesar Castoldi
 
  On Sun, 15 Apr 2001, Scott VanCaster wrote:
 
   I've only been trying to learn this stuff for a few days and thought I
 was
   on a roll, but now have run into a problem I don't get at all.  In my
 script
   I have the following sql query and am receiving the following error
when
 it
   executes "You have an error in your SQL syntax near '' at line 1."
  
   Any idea what my problem is?  I removed the WHERE id=$id and it works,
 but
   updates every record of course :(
  
   I'm lost here.  Thanks for any help.
  
   $sql ="UPDATE members SET ".
 "name='$name', ".
 "email='$email', ".
 "icq='$icq', ".
 "password='$password', ".
 "loginid='$loginid', ".
 "countryid='$countryid', ".
 "gtlogin='$gtlogin', ".
 "gtpass='$gtpass', ".
 "swirvelogin='$swirvelogin', ".
 "swirvepass='$swirvepass' ".
 "WHERE id=$id" ;
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
et
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL Query syntax error... Help?

2001-04-15 Thread Scott VanCaster

Nevermind everyone, I'm an idiot :)

I had the case wrong.  I needed $ID, not $id  !

Thanks for the assistance though.  Nice to know ya'll are here.

Scott


""Scott VanCaster"" [EMAIL PROTECTED] wrote in message
9bd394$ikn$[EMAIL PROTECTED]">news:9bd394$ikn$[EMAIL PROTECTED]...
 I've only been trying to learn this stuff for a few days and thought I was
 on a roll, but now have run into a problem I don't get at all.  In my
script
 I have the following sql query and am receiving the following error when
it
 executes "You have an error in your SQL syntax near '' at line 1."

 Any idea what my problem is?  I removed the WHERE id=$id and it works, but
 updates every record of course :(

 I'm lost here.  Thanks for any help.

 $sql ="UPDATE members SET ".
   "name='$name', ".
   "email='$email', ".
   "icq='$icq', ".
   "password='$password', ".
   "loginid='$loginid', ".
   "countryid='$countryid', ".
   "gtlogin='$gtlogin', ".
   "gtpass='$gtpass', ".
   "swirvelogin='$swirvelogin', ".
   "swirvepass='$swirvepass' ".
   "WHERE id=$id" ;



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTML table to MySQL?

2001-04-08 Thread Scott VanCaster

How would one go about getting each element from an HTML table to a
database?  The HTML will be the source code from a games site score report
pasted into a form.  I'm just learning, so don't waste you're valuable time
explaining every detail of how this can be done, but if someone can point me
in the right direction or a web site detailing something similar it would be
appreciated.  I can come back here with more specific questions once I've
learned enough to know what to ask and understand the answers :)

Thanks.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]