While Loop
Posted: Sun Sep 05, 2010 9:23 pm
My aim here is to take values from one table column, then identify how times that value appears in a 2nd table. I've figured out how to find how many instances of a hard-coded value are present. But how would make this value into an array then check?
Here's what I got so far:
Thanks!
Here's what I got so far:
Code: Select all
<?php
$con = mysql_connect("h50mysql101.secureserver.net","xxxx","xxxx");
mysql_select_db("neesleysqltest", $con);
$schedule = mysql_query("SELECT * FROM schedule");
$i = 0;
while($row = mysql_fetch_array($schedule))
{
if (($row['jakes'])=="Neesley")
{
$i++;
}
if (($row['gin'])=="Neesley")
{
$i++;
}
if (($row['wagon'])=="Neesley")
{
$i++;
}
if (($row['hatch'])=="Neesley")
{
$i++;
}
if (($row['stumble'])=="Neesley")
{
$i++;
}
if (($row['step'])=="Neesley")
{
$i++;
}
if (($row['sheets'])=="Neesley")
{
$i++;
}
}
echo $i;
mysql_close($con);
?>