Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

supplied argument problem in php/mysql

$
0
0

Hello, I'm a beginner php developer so I might sound stupid x.x

I'm working on a website on my local computer using xampp and the website is fine. But then when I tried runing the website online using a webhost (000webhost) I got two errors.

 

the errors:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/assasasas/public_html/index.php on line 15

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sasaasas/public_html/index.php on line 21

 

the code where the errors are:

 

<?php


if(isset($_GET['page'])) $page = intval($_GET['page']); else $page=1;
$max=9;
$from=($max*$page)-$max;
$db_games_t_t = mysql_num_rows(mysql_query("SELECT * FROM games ORDER BY id DESC")); //line 15
$db_games_q = mysql_query("SELECT * FROM games ORDER BY id DESC LIMIT $from,$max");
$db_games_t = mysql_num_rows($db_games_q);
$pages = ceil($db_games_t_t/$max);


$count=0;
while($r = mysql_fetch_array($db_games_q)) { //line 21
$count++;
?>

Viewing all articles
Browse latest Browse all 13200

Trending Articles