Jump to content

timmah1

Members
  • Posts

    1,170
  • Joined

  • Last visited

Everything posted by timmah1

  1. Correct That one is this code case "6-spl": $Ddate = date("Y-m-d"); $firstDate = date("Y-m-01"); $lastDate = date("Y-m-d", strtotime("-1 Day")); $Dtime = date("H:i"); $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start = '".date("Y-m-d")."'"; $w1 = mysql_query($query1); $numrows = mysql_num_rows($w1); if($numrows == 0 ){ //echo "No special for today"; $query3 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start BETWEEN '$firstDate' AND '$lastDate' ORDER BY id DESC LIMIT 1"; $w3 = mysql_query($query3); while($b3 = mysql_fetch_array($w3)){ $id = $b3['id']; $end = date("Y-m-d h:i:s", strtotime($b3['exp'])); $id = $b3['id']; $name = $b3['name']; $package = $b3['package']; $start = date("Y-m-d h:i:s"); $hint = $b3['hint']; $price = $b3['price']; } } elseif($numrows > 0){ //echo "There is a special for today<br />"; $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start = '".date("Y-m-d")."' AND '".date("H:i")."' >= starttime ORDER BY starttime DESC LIMIT 1"; $w1 = mysql_query($query1); $numrows = mysql_num_rows($w1); if($numrows == 0 ) { //echo "Special for today hasn't started yet<br />"; $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start BETWEEN '$firstDate' AND '$lastDate' ORDER BY id DESC LIMIT 1"; $w1 = mysql_query($query1); } while($b2 = mysql_fetch_array($w1)){ //echo "Start time: $b2[starttime]<br />Current time: $Dtime<br />Special for current time"; $id = $b2['id']; $end = date("Y-m-d h:i:s", strtotime($b2['exp'])); $id = $b2['id']; $name = $b2['name']; $package = $b2['package']; $start = date("Y-m-d h:i:s"); $hint = $b2['hint']; $price = $b2['price']; } } break;
  2. I correct that Ken2k7, but it's still not showing
  3. If I echo everything out, it shows with no problem. When you mouseover the [?] on the page, it shows the hint It does that with the top 5, but not the last You can see what I mean here if you want https://www.secure.vegasdsports.com/test/
  4. On my cron jobs, this is the format I use php -q /home/**USERNAME**/public_html/testing/cron/cron_job.php Then on your cron_job.php page, this at the top #!/usr/local/bin/php -q Not this /usr/local/bin/php -q http://mysite.com/testing/cron/cron_job.php
  5. I have a script that grab everything from the database depending on a package type, then shows everything according to the package type. There are 6 packages, everything shows perfect for package 1-5, but for the 6th package, the $hint part does not show. The hint is actually a rollover Can anybody look at the code and tell me why this part of the code don't show the hint? case "6-spl": $Ddate = date("Y-m-d"); $firstDate = date("Y-m-01"); $lastDate = date("Y-m-d", strtotime("-1 Day")); $Dtime = date("H:i"); $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start = '".date("Y-m-d")."'"; $w1 = mysql_query($query1); $numrows = mysql_num_rows($w1); if($numrows == 0 ){ //echo "No special for today"; $query3 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start BETWEEN '$firstDate' AND '$lastDate' ORDER BY id DESC LIMIT 1"; $w3 = mysql_query($query3); while($b3 = mysql_fetch_array($w3)){ $id = $b3['id']; $end = date("Y-m-d h:i:s", strtotime($b3['exp'])); $id = $b3['id']; $name = $b3['name']; $package = $b3['package']; $start = date("Y-m-d h:i:s"); $hint = $b2['hint']; $price = $b3['price']; } } elseif($numrows > 0){ //echo "There is a special for today<br />"; $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start = '".date("Y-m-d")."' AND '".date("H:i")."' >= starttime ORDER BY starttime DESC LIMIT 1"; $w1 = mysql_query($query1); $numrows = mysql_num_rows($w1); if($numrows == 0 ) { //echo "Special for today hasn't started yet<br />"; $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start BETWEEN '$firstDate' AND '$lastDate' ORDER BY id DESC LIMIT 1"; $w1 = mysql_query($query1); } while($b2 = mysql_fetch_array($w1)){ //echo "Start time: $b2[starttime]<br />Current time: $Dtime<br />Special for current time"; $id = $b2['id']; $end = date("Y-m-d h:i:s", strtotime($b2['exp'])); $id = $b2['id']; $name = $b2['name']; $package = $b2['package']; $start = date("Y-m-d h:i:s"); $hint = $b2['hint']; $price = $b2['price']; } } break; Here is the entire code <?php $sport = "nba"; //$sport = "nfl"; //$sport = "ncaaf"; //$sport = "ncaab"; switch($sport){ case "nba": $title = "NBA Basketball"; break; case "nfl": $title = "NFL Football"; break; case "ncaaf": $title = "NCAA Football"; break; case "ncaab": $title = "NCAA Basketball"; break; } ?> <!--start NCAA Football table--> <table width="100%" cellpadding="3" border="1" cellspacing="0" height="175"> <tr> <td align="center" height="15" bgcolor="#000000" class="orderHeader"><?=$title;?></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="25" align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php $sql = "SELECT * FROM packages1 WHERE sport = '$sport' ORDER BY package LIMIT 6"; $q = mysql_query($sql); $numrows = mysql_num_rows($q); if($numrows == 0){ echo "nothing"; } while($a = mysql_fetch_assoc($q)){ //put variables into easily read $id = $a['id']; $name = $a['name']; $package = $a['package']; $start = date("Y-m-d h:i:s"); $price = $a['price']; switch($package){ case "1-sngl": $end = date("Y-m-d 23:59:59"); $hint = $a['hint']; break; case "2-ult": $end = date("Y-m-d 23:59:59", strtotime('+7 days')); $hint = $a['hint']; break; case "3-mnth": $end = date("Y-m-d 23:59:59", strtotime('+30 days')); $hint = $a['hint']; break; case "4-ssn": $end = date("Y-m-d h:i:s", strtotime($a['exp'])); $hint = $a['hint']; break; case "5-po": $end = date("Y-m-d h:i:s", strtotime($a['exp'])); $hint = $a['hint']; break; case "6-spl": $Ddate = date("Y-m-d"); $firstDate = date("Y-m-01"); $lastDate = date("Y-m-d", strtotime("-1 Day")); $Dtime = date("H:i"); $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start = '".date("Y-m-d")."'"; $w1 = mysql_query($query1); $numrows = mysql_num_rows($w1); if($numrows == 0 ){ //echo "No special for today"; $query3 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start BETWEEN '$firstDate' AND '$lastDate' ORDER BY id DESC LIMIT 1"; $w3 = mysql_query($query3); while($b3 = mysql_fetch_array($w3)){ $id = $b3['id']; $end = date("Y-m-d h:i:s", strtotime($b3['exp'])); $id = $b3['id']; $name = $b3['name']; $package = $b3['package']; $start = date("Y-m-d h:i:s"); $hint = $b2['hint']; $price = $b3['price']; } } elseif($numrows > 0){ //echo "There is a special for today<br />"; $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start = '".date("Y-m-d")."' AND '".date("H:i")."' >= starttime ORDER BY starttime DESC LIMIT 1"; $w1 = mysql_query($query1); $numrows = mysql_num_rows($w1); if($numrows == 0 ) { //echo "Special for today hasn't started yet<br />"; $query1 = "SELECT * FROM packages1 WHERE sport = '$sport' AND start BETWEEN '$firstDate' AND '$lastDate' ORDER BY id DESC LIMIT 1"; $w1 = mysql_query($query1); } while($b2 = mysql_fetch_array($w1)){ //echo "Start time: $b2[starttime]<br />Current time: $Dtime<br />Special for current time"; $id = $b2['id']; $end = date("Y-m-d h:i:s", strtotime($b2['exp'])); $id = $b2['id']; $name = $b2['name']; $package = $b2['package']; $start = date("Y-m-d h:i:s"); $hint = $b2['hint']; $price = $b2['price']; } } break; } ?> <tr> <td height="25" align="left" valign="middle"> <span class="purchase"> <?php if($a['price'] == "") { $price = ""; $price_box = "<input name='package_[$name]' type='checkbox' value='$package,$price,$end,$sport' disabled/>"; $dollar = ""; echo $price_box." ".$name; } else { $price1 = number_format ($price, 2); $price = $price1; $price_box = "<input name='package_[$name]' type='checkbox' value='$package,$price,$end,$sport,$id'/>"; $dollar = "$"; echo $price_box." ".$name; } if($hint == "") { } else { ?> <a href="#" onMouseOver="showhint('<?=$hint; ?>', this, event, '200px')">[?]</a> <?php } ?> <br /> </span></td> <td width="55" align="right" valign="middle"><span class="purchase"><?=$dollar;?><?=$price;?> </span></td> </tr> <?php }; ?> </table> <span class="purchase"></span></td> </tr> </table> </td> </tr> </table> <br /> Thanks in advance
  6. Why is this not working? $order = "SELECT * FROM `order_notes` WHERE order = '4'"; $result = mysql_query($order); $numberall = mysql_numrows($result); if ($numberall==0) { echo "<strong>There are no notes for $row[f_name] $row[l_name]</strong>"; } while($row = mysql_fetch_array( $result )){ $formatted_date = date("F j, Y", strtotime($row['date'])); I get this error Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/orderbal/public_html/admin/pages/notes.php on line 14 There are no notes for Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/orderbal/public_html/admin/pages/notes.php on line 18
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.