Thanks,
I found an eventual workaround, but your help gave me some insight. I ended up not using the variable and set it earlier in the code from another source!
Thanks again
Chris
Vincent Driessen wrote:
A link index error often reffers to a missing or incorrect 2nd argument in a mysql_query or mysql_inserted_id statement. If no 2nd argument is given (like in your case), PHP automatically uses your default open data connection. Have a look at this:
$db = mysql_connect("yourserver", "username", "pwd");
mysql_select_db("mydatabase", $db);
You now could say this (assuming that $newresults contains a valid result):
$fileid = mysql_insert_id($newresult);
This is the same as:
$fileid = mysql_insert_id($newresult, $db);
Your problem is (I think) that $db (or whatever you used) is not currently in your scope. This error occurs when you use a function like this:
// $db contains a db-link
function MyFunc() {
// $db is not set here!!
// use GLOBAL
global $db;
}
That global line do it. It could be you are using no function, I still think the problem is in your scope. Hope this will help you.
Greetz,
Vincent Driessen
Venlo,....