RE: Having trouble with this SQL query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:cmccourt@tampabay.rr.com]
Sent: Monday, June 23, 2003 1:28 PM
To: 'CPT John W. Holmes'; 'PHP Lists'
Subject: RE:  Having trouble with this SQL query


Thank you John.

-----Original Message-----
From: CPT John W. Holmes [mailto:holmes072000@charter.net]
Sent: Monday, June 23, 2003 12:10 PM
To: Christopher McCourt; PHP Lists
Subject: Re:  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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux