I m gettin this error when i try to run from a server. www.club.phenyu.com Help needed here as i have more problem i wanna tackle 1 by one thank you
That means it's an invalid query. Look closer at this: SELECT id FROM $tab[user] WHERE code='$pkuser'; The error is something in there. Is "id" a valid field? If so, maybe try changing $tab[user] to the static name of your db to see if the error is there.
take the mysql_query functions out of the mysql_fetch_array functions, and add this after mysql_query(....): or die(mysql_error()); PHP: so instead of: mysql_fetch_array(mysql_query("SELECT id FROM $tab[user] WHERE code='$pkuser';")); PHP: use this: $res = mysql_query("SELECT id FROM $tab[user] WHERE code='$pkuser'") or die(mysql_error()); $id = mysql_fetch_array($res); PHP: The reason why you get this error is because the query probably has an error in it. Try wrapping the tablename in { }, that way php will parse it as a variable. I think at the moment php parses it as {$tab}[user] and not {$tab[user]}. mysql_query("SELECT id FROM {$tab[user]} WHERE code='$pkuser'") or die(mysql_error()); PHP:
the $tab[user] won't work as you expect, you didn't show where this was set and make sure it is mysql_real_escape_string, also its most often easier to read/maintain code written with mysql_fetch_assoc
place it outside the double quotes, or use sprintf: $query = "SELECT id FROM " . $tab['user'] . " WHERE code='" . $pkuser ."'"; PHP: or: $query = sprintf("SELECT id FROM %s WHERE code='%s'", $tab['user'], $pkuser); PHP: i think it should work now
@ doesn't solve the problem, it just silences the error. If that's all you changed, your query isn't working, you just don't see an error.
ok . this mean when i put @ it just silences the script. thats why i was wondering as now i cant register it damn anyone please help me again as i am learning on my own
can you post the code you're using atm, and the error you get when you remove the @ signes? i don't know if the error_reporting is set to maximum, but if not, place these lines on top of your code: error_reporting ( E_ALL ); ini_set ( 'display_errors', '1' ); PHP: If you have an error in your php script, the above code will display it in the window.
its means problem in your query first check your query and add error_reporting ( E_ALL ); ini_set ( 'display_errors', '1' ); that code on the top of lthe page for know the exit problem its function return error repoeting