Re: MySQL Statement Failing in PHP
| From: | Scott Carr | Date: | Thu, 23 Jan 2003 19:55:04 +0000 |
| Subject: | Re: MySQL Statement Failing in PHP | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-18052@lists.php.net to get a copy of this message | ||
A quicky:
echo "$query_rsRegisteredClasses<br />"
To make sure the query is exactly what you are expecting. Copy the exact SQL
statement and run in MySQLAdmin sql window.
PHP to PHP, SQL statement to sql statement.
--
Scott Carr
Documentation Maintainer
http://documentation.openoffice.org
OpenOffice.org
Quoting Dominic <dominic@jet-base.com>:
> I am running a query in a php page that is coming back with no results.
> When I run the same query in MySQL Console, it gives the results. Any
> thoughts?
>
> mysql_select_db($database_Fund, $Fund);
> $query_rsRegisteredClasses = sprintf("SELECT tlogin.FirstName,
> tlogin.LastName, tcourse.Name, tschedule.Date, tschedule.StartTime,
> tschedule.EndTime, tlogin.LoginName FROM ((tregistration INNER JOIN
> tschedule ON tregistration.ScheduleUID = tschedule.ScheduleUID) INNER JOIN
> tlogin ON tregistration.StudentUID = tlogin.LoginUID) INNER JOIN tcourse ON
> tschedule.CourseUID = tcourse.ClassID WHERE tlogin.LoginName = '%s'",
> $user_rsRegisteredClasses);
> $rsRegisteredClasses = mysql_query($query_rsRegisteredClasses, $Fund) or
> die(mysql_error());
> $row_rsRegisteredClasses = mysql_fetch_assoc($rsRegisteredClasses);
> $totalRows_rsRegisteredClasses = mysql_num_rows($rsRegisteredClasses);
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/