RE: [PHP-DB] Having trouble with this SQL query
I think you are getting an error because you are using User as the table name which I believe is a reserved keyword. If you change the name to users it would probably work fine. -Original Message- From: Christopher McCourt [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 1:28 PM To: 'CPT John W. Holmes'; 'PHP Lists' Subject: RE: [PHP-DB] Having trouble with this SQL query Thank you John. -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 12:10 PM To: Christopher McCourt; PHP Lists Subject: Re: [PHP-DB] Having trouble with this SQL query > First of all, I'm a newbie to PHP and MYSQL and started working on a > create table query in PHP to execute on MYSQL. Can someone take a quick > look at the following code to see if there are any problems? Can you > also advise some tips on debugging? Print out your SQL queries when debugging. Make sure they look correct. (Not an issue in your case, though, since you're not inserting any variables into the SQL.) Also, use mysql_error() in conjunction with mysql_query(). $rs = msyql_query($sql) or die(mysql_error()); or example. Wrapping your sql queries in a simple abstraction layer will make debugging easier, too. You could use a simple db_query($sql) function call and have error checking built into the function and handle all queries the same. ---John Holmes... -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Having trouble with this SQL query
Thank you John. -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 12:10 PM To: Christopher McCourt; PHP Lists Subject: Re: [PHP-DB] Having trouble with this SQL query > First of all, I'm a newbie to PHP and MYSQL and started working on a > create table query in PHP to execute on MYSQL. Can someone take a quick > look at the following code to see if there are any problems? Can you > also advise some tips on debugging? Print out your SQL queries when debugging. Make sure they look correct. (Not an issue in your case, though, since you're not inserting any variables into the SQL.) Also, use mysql_error() in conjunction with mysql_query(). $rs = msyql_query($sql) or die(mysql_error()); or example. Wrapping your sql queries in a simple abstraction layer will make debugging easier, too. You could use a simple db_query($sql) function call and have error checking built into the function and handle all queries the same. ---John Holmes... -- 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] Having trouble with this SQL query
> First of all, I'm a newbie to PHP and MYSQL and started working on a > create table query in PHP to execute on MYSQL. Can someone take a quick > look at the following code to see if there are any problems? Can you > also advise some tips on debugging? Print out your SQL queries when debugging. Make sure they look correct. (Not an issue in your case, though, since you're not inserting any variables into the SQL.) Also, use mysql_error() in conjunction with mysql_query(). $rs = msyql_query($sql) or die(mysql_error()); or example. Wrapping your sql queries in a simple abstraction layer will make debugging easier, too. You could use a simple db_query($sql) function call and have error checking built into the function and handle all queries the same. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Having trouble with this SQL query
Hi to all: First of all, I'm a newbie to PHP and MYSQL and started working on a create table query in PHP to execute on MYSQL. Can someone take a quick look at the following code to see if there are any problems? Can you also advise some tips on debugging? Thank you in advance for your assistance. Take care, Chris McCourt PHP code: HTML> Creating a Database