What does this Error mean in PHP?

  • Thread starter Thread starter Nabendu Maji
  • Start date Start date
N

Nabendu Maji

Guest
Can any one tell me why users are gating this error sometimes while registering in to the website?


Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /tmp/Ujb8cR on line 36

Warning: Cannot modify header information - headers already sent by (output started at /tmp/Ujb8cR:36) in /tmp/Ujb8cR on line 37


What Does this Error mean?
Any solution?
 
The first error means that you are attempting to execute a MySQL query without defining or referencing a connection.

Example:
Connect:
$link = mysql_connect("localhost", "user", "pass");

Select Database, using $link as your reference:
mysql_select_db("database", $link);

Then execute your query:
mysql_query(.. query..., $link);

Same goes for errors. Add the reference
mysql_error($link);

The second is a result of the first - since the SQL error printed something on the page, additional HTTP headers cannot be sent out (all headers must be defined before any output is printed).
 
Back
Top