Forum Moderators: coopster

Message Too Old, No Replies

quick mysql syntax error

trying to update a mysql db

         

ahmedtheking

7:48 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For all you MySQL peeps out there, where have i gone wrong?

$Query = "UPDATE $TableName SET pgname = '$Array[pgname], title = '$Array[title]', contenttitle = '$Array[contenttitle]', body = '$Array[body]' WHERE id = '$Array[id]'";
print ("The query is:<BR>$Query<P>\n");
if (mysql_db_query ($DBName, $Query, $Link)) {
print ("The query was successfully executed!<BR>\n");
} else {
print ("The query could not be executed!<BR>\n");
echo mysql_error();
}

Brings out:

The query is:
UPDATE WebSite SET pgname = 'index, title = 'Home', contenttitle = 'Sometimes, You\'re Looking for Extraordinary Solutions', body = '

Hi, welcome to FireStarter\'s web site. If you\'re looking for generic (templates, etc...) web solutions then you risk looking like everyone else who uses these solutions... If you want to stand out and make an extraordinary impact on the market then we are the people for you.

The FireStarter Media Group have been established since 2001. From that time, we have expanded, evolved and become bigger and better. We have helped a wide variety of clients get noticed in their specialised market and get the customers they need.

Can we do the same with you? Try us out! Have a look at our clients, services and contact us if you need any more information.
This is a test
' WHERE id = '1'

The query could not be executed!
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Home', contenttitle = 'Sometimes, You\'re Looking for Extraordi

Thanks :D

Birdman

7:55 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You left a quote out:

UPDATE WebSite SET pgname = 'index', title = 'Home', contenttitle =...

ahmedtheking

8:01 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you're a legend! Thanks!