Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource

Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource

You have just gotten a warning when trying to check if an inserted row was successful but when calling mysql_affected_rows(mysql_query(“INSERT INTO……”)) you get a warning telling you that the supplied argument is not a valid MySQL-Link resource.

This is because mysql_query INSERT actually returns true or false and not a resource id.

So rather do this:

if (mysql_query(“INSERT INTO…”))

Tags:
0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments