mysql_fetch_array can't get all rows to display

Prety new to php trying to figure out why my if elseif statement is not working. The else statement seems to be working but if the license.emissions is changed to something else it does not display per the if statement. Let me know if you need more clarification.

[php]<?php
echo “

”;
echo "";
mysql_connect(“localhost”,“user”,“pass”) or die (Mysql_error());
mysql_select_db(“mcafee”);
$start = date(“Y”);
$end = mysql_query(“select customers., contacts., license.* from customers INNER JOIN contacts ON customers.company_name = contacts.company_name INNER JOIN license ON customers.company_name = license.company_name”);
while ($row = mysql_fetch_array($end)){
$interval = $row[‘expirationy’] - $start;
if ($row[‘emissions’] != “11K2F3E”){ ?> <?php }elseif ($interval <= 1) { ?> <?php } } ?>
    Customer Name Contact Phone Call Sign Expiration Date Emissions
<?php echo $row['company_name']; ?> <?php echo $row['contact_name']; ?> <?php echo $row['phone']; ?> <?php echo $row['callsign']; ?> <?php echo $row['expirationm']; ?>/<?php echo $row['expirationd']; ?>/<?php echo $row['expirationy']; ?> <?php echo $row['emissions']; ?>
<?php echo $row['company_name']; ?> <?php echo $row['contact_name']; ?> <?php echo $row['phone']; ?> <?php echo $row['callsign']; ?> <?php echo $row['expirationm']; ?>/<?php echo $row['expirationd']; ?>/<?php echo $row['expirationy']; ?> <?php echo $row['emissions']; ?>
[/php]

The bast way to solve any error is to find it in every statement for example you use var_dump() and put the variable $end in it and put exit; after that and run your code in browser and you will find what is wrong with your sql query.

Sponsor our Newsletter | Privacy Policy | Terms of Service