Jump to content
php.lv forumi

mysql select


Dutchyz

Recommended Posts

kas šeit varētu būt nepareizi, ja visi tabulas dati sakrīt?

 

<?php

$dbhost = 'localhost';
$dbuser = '***';
$dbpass = '***';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die					  ('Error connecting to mysql');

$dbname = '***';
mysql_select_db($dbname);


$select="products_id, products_name from products_description";
$sql_result=mysql_query($select);
$rows=mysql_num_rows($sql_result);

for ($n=0; $n<$rows; $n++){

$row=mysql_fetch_object($sql_result);
echo $row->products_id . " || " . 
	$row->products_name . "\n";

}


?>

 

dabūju laukā :

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in * on line 15

Link to comment
Share on other sites

×
×
  • Create New...