Jump to content
php.lv forumi

nolasīt no datubāzes


ziedinjsh

Recommended Posts

ir sadaļa report kur ir 3 titpi. ar select izvēlas vienu no viņiem aizpilda pārējo informāciju un ievada datu bāzē.. kā lai es izvadu katru tipu atsevišķi

meiģināju šādi:

$r = (isset($_GET['r'])) ? $_GET['r'] : '';

echo "<a href='index.php?id=report&r=payment'>Payment</a> | ";
echo "<a href='index.php?id=report&r=bug'>Bug</a> | ";
echo "<a href='index.php?id=report&r=advice'>Advice</a>";


if($r=='payment'){
$query  = "SELECT * FROM d7 WHERE type='payment'";
$result = mysql_query($query);

while($data = mysql_fetch_assoc($result))
{
echo "".$data['date']."";
echo "".$data['title']."";
echo "".$data['message']."";
}
}
if($r=='bug'){

}
if($r=='advice'){

}

 

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in D:\WEB\xampp\htdocs\sell\admin\report.php on line 14

 

ko es daru nepareizi?

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...