Tim,

I know you said you're not getting any errors back, but did you try echoing
out mysql_error() in your function?  Also, if you take what the value of the
$yyyymmdd from the form and try running the query (in your function) via the
MySQL client, does it work?  One other thing you may need is single ticks in
your query around the $yyyymmdd, like this: '$yyymmdd'

Josh Hoover
KnowledgeStorm, Inc.

Searching for a new IT solution for your company? Need to improve your
product marketing? 
Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify
the process for you.
KnowledgeStorm - Your IT Search Starts Here



> -----Original Message-----
> From: Timothy Wright [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 10:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] What's wrong with this code?
> 
> 
> Hello -
> 
> I'm not getting any errors on this... and the variable is 
> passing from the
> form on the other page, but I'm getting empty result sets 
> when I know there
> should be data.
> 
> 
> <?
> $link = mysql_connect ("localhost", "www", "scripts4") or die 
> ("Could not
> connect");
> $db = mysql_select_db ("schileens_db") or die ("Could not 
> select database");
> ?>
> <TITLE>Weekday events</TITLE>
> </HEAD>
> <BODY>
> <?
> # make function #
>  function display_events ()
> {
> # declare global variable coming from other page #
> global $PHP_SELF;
> # select events for this day #
> $query="select msg_year, msg_month, msg_day, msg_title from
> calendar_messages where CONCAT(msg_year,msg_month,msg_day) = 
> $yyyymmdd" ;
> $result=mysql_query ($query) or die ("cannot execute query");
> 
>       while ($row = mysql_fetch_array ($result))
>       {
>               printf ("%s %s %s %s<BR>\n", $row["msg_year"], 
> $row["msg_month"],
> $row["msg_day"], $row["msg_title"]);
>       }
>       mysql_free_result ($result); } ;
>  ?><A href="drop5.php">back to weekday selection
> </A>
> 
> Thanks in advance for any help!
> 
> Tim Wright

Reply via email to