Wedvich
02-26-2005, 08:34 AM
I was running a development environment using Apache 2, PHP 4.3.10 and MySQL 4.1.9, and I could do this:
$sql = 'SELECT config_value FROM cd_config WHERE config_name = \\'style\\'';
$style = mysql_result(mysql_query($sql), 0);
(note that there are \ slashes before the quotes around the "style" value, but the bbcode here strips them)
Then I did a mistake and deleted some files that MySQL needed, and I had to reinstall MySQL, albeit now version 4.1.9 was replaced with 4.1.10. Whatever, I thought, and I went ahead and installed it. However, when I now tried to run the same piece of code I showed above, I got the following error:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in C:\Apache2\htdocs\index.php on line 12
Whatever I try I just can't get the mysql_result function to work. Does anyone know what I can do?
$sql = 'SELECT config_value FROM cd_config WHERE config_name = \\'style\\'';
$style = mysql_result(mysql_query($sql), 0);
(note that there are \ slashes before the quotes around the "style" value, but the bbcode here strips them)
Then I did a mistake and deleted some files that MySQL needed, and I had to reinstall MySQL, albeit now version 4.1.9 was replaced with 4.1.10. Whatever, I thought, and I went ahead and installed it. However, when I now tried to run the same piece of code I showed above, I got the following error:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in C:\Apache2\htdocs\index.php on line 12
Whatever I try I just can't get the mysql_result function to work. Does anyone know what I can do?