N
Nathan
Guest
Using the following code:
<?php
$queryitems = mysql_query("SELECT * FROM `springnews` ORDER BY `id` DESC");
while($cool = mysql_fetch_object($queryitems))
{
$path = $cool->image;
$getsize = mysql_fetch_object(mysql_query("SELECT * FROM `springimages` WHERE `path`='$path'"));
echo" <p>$cool->date<br />
<strong>$cool->title</strong><br />
<img src='../img/pdficon.jpg' width='20' height='21'><a href='$cool->image' class='newsLink'>Click to read the full article.</a> (PDF:".sizefile($getsize->size)." ) </p>";
}
?>
I have two tables in a DB, one holds the 'news' and the other hold all information on uploaded files.
Im looping the news table as you can see so it displays all the results in there, but i also want to rake one column of information from the uploaded files table and match it with the news result.
But with the code above, i get the following error;
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/fhlinux195/e/eon-media.com/user/htdocs/spring/home/news.php on line 94
Im not the best at stringing words together haha but you should be able to gather from my code what im trying to do.
Any help would be appreciated, thank you.
<?php
$queryitems = mysql_query("SELECT * FROM `springnews` ORDER BY `id` DESC");
while($cool = mysql_fetch_object($queryitems))
{
$path = $cool->image;
$getsize = mysql_fetch_object(mysql_query("SELECT * FROM `springimages` WHERE `path`='$path'"));
echo" <p>$cool->date<br />
<strong>$cool->title</strong><br />
<img src='../img/pdficon.jpg' width='20' height='21'><a href='$cool->image' class='newsLink'>Click to read the full article.</a> (PDF:".sizefile($getsize->size)." ) </p>";
}
?>
I have two tables in a DB, one holds the 'news' and the other hold all information on uploaded files.
Im looping the news table as you can see so it displays all the results in there, but i also want to rake one column of information from the uploaded files table and match it with the news result.
But with the code above, i get the following error;
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/fhlinux195/e/eon-media.com/user/htdocs/spring/home/news.php on line 94
Im not the best at stringing words together haha but you should be able to gather from my code what im trying to do.
Any help would be appreciated, thank you.