Help with PHP

Okay, so, we did debug the ID number. (make sure there are no extra spaces between the number and the ***'s. That would cause a mismatch against the database.)

Next, we check to see if it is pulling the correct values from the database query. So, remove the die line again.
And, do part two:

What that will do is show the actual customerID that is being selected. Then, you will see if there is some odd thing being passed back to the page. If the customer ID used is displayed as you expected (minus the stars which I use to see extra spaces, no spaces allowed in database!), then next you would have to debug the query. To do that, AFTER these lines: $account_list = ""; $sql = mysql_query("SELECT * FROM transactions WHERE customerID='" . $_SESSION['customerID'] . "'"); $accountCount = mysql_num_rows($sql); Put this line: $die($accountCount); This will show the count you are getting from the query. If zero, than you have no sample purchases in the account info for that customer ID...
If it is zero, then this is the section of error. If it is 1 then, it is the next part... Let me know...

$die($accountCount);

Call to undefined function for that line?

Oh, man, I must be asleep! Remove the $…

Removed the $ before die, and now I just get a blank page with nothing displaying.

There you go! You do not that that ID in the database OR the query is wrong.
Log into your database and look at the records and see if are transactions for that ID.
And, check the spelling in the query, too. If transactions or customerID is spelled wrong it won’t work.

If you don’t find anything, please repost your code for that part inside the php tags. Good luck…

;D ;D ;D

Its working!!

Thanks for your help, and no doubt I will be back asking for more soon …

Great! Glad I stuck with you… Hard to debug without hands on the entire project. Glad you hung in there too!

I will mark it solved. You can start a new post on the next problem… We can help…

CYA in the bitstream…

Sponsor our Newsletter | Privacy Policy | Terms of Service