I recently purchased a small website that uses PHP & MySQL. It worked perfectly on another hosting company, but when I installed it on my server it will not work properly.
I believe it is perhaps a MySQL issue as the previous version of MySQL was 4.1.12, and now I am using it on version 4.1.20.
The script is reading and writing to the DB, although it is not working correctly. I am seeing the following errors:
PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/….
And the script is not reading and writing cookies correctly. Here is one sample section of the script that is giving errors:
<? }
} else if ($type == "my-favorites") {
$query_2 = "SELECT * FROM favorites WHERE cookie_id = $cookie_id ORDER BY rand() DESC";
$queryResource_2 = mysql_query($query_2);
while ($row_2 = mysql_fetch_array($queryResource_2, MYSQL_ASSOC)) {
$resource_id = $row_2['resource_id'];
$query = "SELECT * FROM resources WHERE resource_id = $resource_id AND category_id = $id";
$queryResource = mysql_query($query);
if ($row = mysql_fetch_array($queryResource, MYSQL_ASSOC)) {
$title = ShortenText($row['title'],45);
$url = ShortenText($row['url'],60);
$temp_div_number++;
$row_count++; ?>
I am looking for someone who understands PHP and MySQL, and can make my site work correctly. Site also uses AJAX, but I do not believe there is a problem with this.