[email protected] wrote:
> Hi Jim,
>
>> Take a look inside your money_format() function look for the problem.
>
> I apologize for replying too quickly.
>
> The money_format() function looks just like the one I had before, so
> that's fine.
>
> Upon closer inspection, I found a few problems:
>
> 1] WHERE categories='{$cat}"'
> should be
> WHERE categories='{$cat}'
Sorry, my bad
>
> 2] if ( ( $results = mysql_query($SQL, $db) !== false ) {
> should be
> if ( $results = mysql_query($SQL, $db) !== false ) {
>
But, you do want the first line, expect with the closing bracket.
if ( ( $results = mysql_query($SQL, $db) ) !== false ) {
You want to have the inner portion processed then the comparison done.
Not the other way around.
> With those fixed, the page is rendering now, but giving me this error:
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL
> result resource
>
> for this line:
> while ( $item = mysql_fetch_assoc($result) ) {
>
Should be
while ( $item = mysql_fetch_assoc($results) ) {
> and the tables are blank. Only the table headers show. So...
> everything except the while statement appears to be working.
>
> I've Googled that error message but can't find the casue. Any help
> would be much appreciated.
>
> Frank
Sorry about the other typo's!
Jim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php