Jump to content

Error with MySQL integration.


davidknag

Recommended Posts

i get

	

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\AtomicPool\s.php on line 93

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\AtomicPool\s.php on line 95

 

when i use this code:

 

			  <?php
			$dbhost  = 'xxxx';
$dbname  = 'xxxx';
$dbuser  = 'xxx';
$dbpass  = 'xxxxxx';

$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

if (isset($_GET['cat'])){
  $cat = $_GET['cat'];
  $get_cat = mysql_query("SELECT * FROM categories WHERE Short Name = '$cat'");
  $get_cat_rows = mysql_num_rows($get_cat);             --This is Row 93
  if ($get_cat_rows=1){
    while ($fetch = mysql_fetch_assoc($get_cat)){          --This is Row 95
        $categoryyyy = $fetch['Name'];






$categ = "".$categoryyyy." Games"; 
        

    }
  }
   

}
else
     echo "Looks like someone has been playing with the URL bar...";

 ?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/225349-error-with-mysql-integration/
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.