Jump to content

Pass variable from PHP to mysql


gw32

Recommended Posts

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.