Hi,
This is my first time posting here, so I hope I am not missing something very obvious. I have already successfully created a PHP page that outputs journal article citations, but I also want to include links to some of the articles that my library has online or owns the journal titles. These links are in the database, but I can't seem to figure out how to write the PHP to properly evaluate it. Here is an example of what I have come up with so far:
<?php
if ( $totalRows_DeptQuery1a == 0)
{
echo "<p>There are NO CITATIONS for this query.</p>";
}
else
{
echo "<p>The following $totalRows_DeptQuery1a citation(s) were found from the <a href=". $row_DeptQuery1a['DeptURL'] . " target='new.html'>" . $colname_DeptQuery1a . " Department.</a></h4></p>";
}
{
do
{
if ( $row_DeptQuery1a['AURL'] == NULL)
{
echo "<p>This citation does not have a link.</p>";
}
if ($row_DeptQuery1a['AURL'] = 1)
{
echo "<p>This citation DOES INCLUDE a link.</p>";
}
}
while( $row_DeptQuery1a = mysql_fetch_assoc($DeptQuery1a));
}
However, a problem occures when the query results in zero. I thought it would ignore everything within the DO...WHILE loop, once it qualified as no citations, but it continues to prove true to the second IF and outputs the PHP, since there is actaully nothing in the database to find.
Is this clear? If not, I can clarify it a little more, or if anyone has any ideas for possible solutions, I would be really greatful! Would it help if I said you would be helping to educate the future since I am a librarian?? (Probably not, I know!)
Thanks for your help!
RealBopeep