Jump to content
php.lv forumi

Kļūda whilā


yeahz

Recommended Posts

	if (!empty($_GET['atdod'])) {	

	if ($_GET['atdod'] == $_GET['nem']) {
	echo "Izvēlies atšķirīgus parametrus, ko mainīt.";
	footer();
	exit;
	}

	$yo = mysql_query("SELECT * FROM tirgus_maina WHERE maina=$_GET[atdod] AND pret=$_GET[nem]");
	echo "<table width='100%' border='1' cellspacing='0' cellpadding='0'>";
	echo "<td>Lietotājs</td><td>Maina, daudzums</td><td>Pret, daudzums</td><td>Pievienošanas laiks</td>";
	while ($r = mysql_fetch_array($yo)) {
		$he = mysql_query("SELECT username,id FROM users WHERE id=$r[user_id]");
		$user = mysql_fetch_array($he);
		echo "<td>$user[username]</td><td>$r[maina]<br />$r[maina_daudzums]</td><td>$r[pret]<br />$r[pret_daudzums]</td><td>" . date("Y",$r['laiks']) . "</td>";
	}
	echo "</table>";
}

 

Kur ir kļūda?

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... on line 22

 

22 līnija ir while ($r = mysql_fetch_array($yo)) {

Edited by yeahz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...