|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||||
|
|||||
|
Newbie PHP/MySQL problem
Hi, I'm learning how to run PHP/MySQL from tutorials on this site. They're really great. I was using one of the given examples, which I'd modified for my database. The problem is that when I access the PHP file, it doesn't return a darn thing. Just a white page. What did I screw up?
php Code:
|
|
#2
|
|||||
|
|||||
|
RE: Newbie PHP/MySQL problem
Are you sure that the mysql connection and db select is working?
Try changing second line to something like: php Code:
This will tell you if the db server is not letting you in, or if the db cannot be selected. J |
|
#3
|
|||||
|
|||||
|
RE: Newbie PHP/MySQL problem
Well, I completely cropped the rest of my php script out and put your code in. This is my code:
php Code:
It pulls up a blank page, too. Now I'm really confused. When I View Source both this page and my other php page that wasn't working, both show <HTML><BODY></BODY></HTML> in the source and nothing more. Despite this, other PHP and MySQL scripts are working. ARGH! Thanks if you can help. |
|
#4
|
|||
|
|||
|
RE: Newbie PHP/MySQL problem
That's a good thing!
When php parses, it's invisible at source. What you are seeing is the <HTML><BODY></BODY></HTML> tags that you have put around your php code (remember that php does not have to be located within the <BODY> tag though - you can stick php right at the top and do your html afterwards. The only time that you would see something else from the below code is if there was a problem and the echo error or die statement come into play. As there is nothing else being displayed it means that you are connected correctly to the db server and are allowed access to the selected db. If this was working in your first code then I suggest adding a check on your $result after running the sql like: to see if your sql is executing correctly. It may be that there is a problem with your $_GETs. (might be worth doing an echo $_GET['first_name']; etc for each of your variables at the top of your php to see if they are being passed correctly) I also notice that you are using $_GET[first_name]; instead of $_GET['first_name']; this may be the cause of all your woes! Good luck and let me know how you get on, J |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > Newbie PHP/MySQL problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|