I’m expecting the following code to produce an error in PHP, but it runs without any sign of error.
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
$link = mysql_connect('localhost','JUST_ANY_TEXT EVEN WITH SPACES', '');
mysql_select_db('JUST_ANY_TEXT EVEN WITH SPACES', $link);
echo 'LINK RESULT = '.($link?'OK':'ERROR'); //THIS PRINTS: LINK RESULT = OK
echo mysql_query("SELECT INVALID_TEXT FROM TABLE_THAT_DOES_NOT_EXISTS_ANYWHERE PLUS ANY TEXT 3[t3p36g333 3 4638343´tp4oy0i9u54t-9u´089hwpjoeg~,ç");
This works as intended. If you check out the official documentation you will see that there is a return value form most of the functions. You should check that return value to make sure everything is fine.
Also these legacy
mysql_*functions are quite outdated. I would suggest using the PDO package instead.To point out the immediate error in your code. You should use it like: