Jump to content

gw32

Members
  • Posts

    33
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by gw32

  1. I found it. Thanks anyway
  2. I have this code which works great except for one minor detail. SELECT name, lic_num, purpose FROM charity where start_date < NOW() AND end_date > NOW() It displays nothing when NOW() equals either start_date or end_date. Any suggestions? Thanks
  3. Thanks. It worked. I just did what was in my book on how to pass variables. Gotta get a different book! Thanks again
  4. You guys are great, thanks again for the help last week. Now I almost got this working but a small hiccup. here is my code: <?php include("config.php"); $my_t=getdate(date("U")); $my_t1=$my_t[weekday]; $result = mysql_query("SELECT * FROM tourney where day_of_week = '$my_t1'") or die(mysql_error()); if ($result == '') echo "<br>Empty Set\n"; print_r ($my_t1); This prints correctly while ($result = mysql_fetch_array($result,MYSQL_ASSOC)) { This is my error. "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hermes/bosweb/web017/b172/ipg.dswdesignsnet/pp4c/charity1.php on line 8" print "<b>Starting Time: <br></b>".$row{'start_time'}."<br><b>Tournament: </b><br>".$row{'tourney'}."<br><b>Buy-in: <br>".$row{'buy_in'}."<br><b>Starting Chips: <br>".$row{'start_chips'}."</font><p>"; This prints headers correctly, but no variables. } mysql_close($dbh); ?> What did I forget to do or what did I do wrong. I'm still learning mysql and php.
  5. THANKS That was the simplest answer and yet I was so far off it wasn't funny. THANKS
  6. In my HTML code I am using it like this: <tr valign="top"> <td height="22" align="right" valign="middle"><!-- <img src="images/bult-gamblingtemplatesdotnet.jpg" width="11" height="11"> --></td> <td height="22" valign="middle"><class="navbar3"><?php include("test.php"); ?></td> </tr> Here is the webiste as it sits using the above: http://dswdesigns.net/pp4c/index.html Here is the stand alone code of test.php and it works: http://dswdesigns.net/pp4c/test.php Thanks
  7. It's in a .php file and I'm using include Here is the test.php file; <?php include("config.php"); $result = mysql_query("SELECT name, lic_num, purpose FROM charity where sysdate() between start_date and end_date"); while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { print "<b>Charity: </b>".$row{'name'}."<br><b>License #: </b>".$row{'lic_num'}."<br><b>Purpose: </b>".$row{'purpose'}."<p>"; } mysql_close($dbh); ?> Where config.php is the database connect info.
  8. This doesn't work inside html. <tr valign="top"> <td height="22" align="right" valign="middle"><!-- <img src="images/bult-gamblingtemplatesdotnet.jpg" width="11" height="11"> --></td> <td height="22" valign="middle"><class="navbar3"> <?php include("config.php"); $result = mysql_query("SELECT name, lic_num, purpose FROM charity where sysdate() between start_date and end_date"); while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { print "<b>Charity: </b>".$row{'name'}."<br><b>License #: </b>".$row{'lic_num'}."<br><b>Purpose: </b>".$row{'purpose'}."<p>"; } mysql_close($dbh); ?></td> This is the output on the website. Charity: ".$row{'name'}." License #: ".$row{'lic_num'}." Purpose: ".$row{'purpose'}." "; } mysql_close($dbh); ?> When I do this <tr valign="top"> <td height="22" align="right" valign="middle"><!-- <img src="images/bult-gamblingtemplatesdotnet.jpg" width="11" height="11"> --></td> <td height="22" valign="middle"><class="navbar3"><?php include("test.php"); ?></td> </tr> I get this Can someone please point me in the correct direction? Also if I run the code as a stand alone it works perfectly. Thanks
×
×
  • 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.