Jump to content

[SOLVED] mysql_fetch_array() problem


sneamia

Recommended Posts

<?php
error_reporting(E_ALL);
switch ($_GET['purpose']) {
case 'news':
	$result = mysql_query('SELECT `fulltext` FROM `news` WHERE `newsID` = ' . htmlentities($_GET['argument'] . ' AND `deleted` = 0', ENT_QUOTES));
	$fulltext = mysql_fetch_array($result);  /* Line 8. */
	echo 'document.getElementById("text_' . htmlentities($_GET['argument']) . '").innerHTML = "' . str_replace(array("\n", "\r", "\r\n"), '', $fulltext[0]['fulltext']) . '";';
	break;
default:
}
?>

 

That's ajax.php.

 

When I call .../assets/ajax/?purpose=news&argument=2, it gives me a:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .../assets/ajax/index.php5 on line 8

Link to comment
https://forums.phpfreaks.com/topic/77090-solved-mysql_fetch_array-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.