This question already has an answer here:
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..
</div>
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.
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/>";
}
?>