Not a valid MYSQL link?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
odie2828
Forum Commoner
Posts: 39
Joined: Tue Aug 05, 2008 4:40 pm

Not a valid MYSQL link?

Post by odie2828 »

This is the code that is creating the problem:

Code: Select all

$result = mysql_query("INSERT INTO news (title, dtime, text1)
         
                            VALUES ('$title',NOW(),'$text1')",$connect);

line 3 it returning the problem:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /../../../../../add_news.php on line 37
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Not a valid MYSQL link?

Post by RobertGonzalez »

Means that $connect is not a valid connection. Did you verify the $connect var?
odie2828
Forum Commoner
Posts: 39
Joined: Tue Aug 05, 2008 4:40 pm

Re: Not a valid MYSQL link?

Post by odie2828 »

I looked into the $connect var and you were correct... there was an extra "," in the string.

thank you
Post Reply