Dutchyz Posted February 6, 2008 Report Posted February 6, 2008 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
andrisp Posted February 6, 2008 Report Posted February 6, 2008 Nepareizs kverījs. Google: sql select select products_id, products_name from products_description
Dutchyz Posted February 6, 2008 Author Report Posted February 6, 2008 (edited) Bet ko darīt ja piemēram es no a tabulas gribu a veriibu dabuut, bet no b tabulas b vertiibu? Edited February 6, 2008 by Dutchyz
Paulinjsh Posted February 6, 2008 Report Posted February 6, 2008 (edited) nuļķības sarakstīju! Edited February 6, 2008 by Paulinjsh
Aleksejs Posted February 6, 2008 Report Posted February 6, 2008 SELECT a AS lauks FROM a UNION SELECT b AS lauks FROM b
Paulinjsh Posted February 6, 2008 Report Posted February 6, 2008 vispār palasi mysql pamatus latviski http://datubazes.wordpress.com/ vai angliski http://dev.mysql.com/
Recommended Posts