-6

Hello I AM getting this error i am a newbie pls help..

<?php
$queryyy=mysql_query($conn,"select * from comments where type='".$platform."' AND app_id=".$id." order by id DESC");
$queryyy = mysql_query($sql);
if (!$queryyy) {
   die('Invalid query: ' . mysql_error());
   }


while($rowww=mysql_fetch_array($queryyy))
{
echo $rowww['comm']."<hr/>";
}
?>

Here is my code..

Punjabii
  • 3
  • 4

2 Answers2

1

try this

    <?php
$queryyy=mysql_query("select * from comments where type='".$platform."' AND app_id=".$id." order by id DESC") or die(mysql_error());//it will give you the right error



while($rowww=mysql_fetch_array($queryyy))
{
echo $rowww['comm']."<hr/>";
}
?>

Learn mysqli or PDO.

And in MYSQL connection is optional and its second parameter not first.

arif_suhail_123
  • 2,521
  • 2
  • 10
  • 16
0

Try this ...

<?php
//use your connection file here...
$queryyy=mysql_query("select * from comments where type='$platform' AND app_id='$id' order by id DESC");
if (!$queryyy) {
   die('Invalid query: ' . mysql_error());
   }
while($rowww=mysql_fetch_array($queryyy))
{
echo $rowww['comm']."<hr/>";
}
?>
sameer kumar
  • 149
  • 1
  • 3
  • 12