|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Okay, you all have probably got this question a million times, but I am a Newbie, sorry. When I try to create a database in MySQL via PHP, the browserpage to view it comes up so slow that it actually just sits there not coming up at all. The bar on the bottom of the browser go one bar every somany minutes and even after an hour, nothing changed. I use IE 6.0
I have EasyPHP installed and I went to PhpMyAdmin and the database was created. I set the password and host and user all to 'any' hoping that would work (I read that in another post) but it didn't work. I don't have an internal firewall installed. I am on a corporate network. I can view any php file I created in the browser using http://localhost/nameoffile.php and it works. I am following the "Try It Out-Creating a Database" from Ch3 in the book "Using PHP with MySQL" and I have the complete script pasted from the book. It also seems strange that the database was created, the script just won't let me see that I did it. Any idea what I can do to fix it? Thanks, Patricia |
|
#2
|
|||
|
|||
|
The first step is to post a relevant and comprehensive portion of your code that is problematic, then we can take it from there.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
||||
|
||||
|
Find the source of the problem
do other PHP scripts work? ones without database connectivity? how about ones WITH database connectivity? If yes, then it must be your script: is your query correct? often a page will hang when its waiting for the database to return something. it may be caused by an infinite loop. If no, then it must be your server: check any server logs. try rebooting the server... try reinstalling PHP... try reinstalling the server. |
|
#4
|
|||
|
|||
|
The funny thing is everything works like a charm and the database is created. When doing pages to pull data from the database, then it also works. It just will not display the "Movie Database successfully created!"; instead it just hangs up. I also tried viewing it from within PHP Expert Editor and it just shows a blank page. In IE is shows the moving bar on the bottom but gets stuck after three bars. This is the code:
PHP Code:
|
|
#5
|
|||
|
|||
|
User overview
This is from phpMyAdmin:
User overview User Host Password Global privileges Grant Any % No ALL PRIVLEGES Yes root localhost No ALL PRIVLEGES Yes I hope that also helps. |
|
#6
|
||||
|
||||
|
For the record, I suggest you password ALL accounts...
*especially* ones with external access (where host is %) Also, *never* present your password [or lack of] to a forum... Its just something to be cautious of, I see people do it all the time. It's courteous, fun, and more readable if you post your code with [php][/php] tags surrounding it. As for a possible solution... um... try putting echo messages after every query statement... or run the SQL statements directly on the database... |
|
#7
|
|||
|
|||
|
Try this:
comment out this section: //mysql_create_db("wiley") or die(mysql_error()); create the database manually now run the script... see if it creates the tables? |
|
#8
|
|||
|
|||
|
It does create the tables and will work with them afterwards. It just doesn't give me the "Movie Database successfully created!" at the end, instead, it hangs up. I realize this is strange...
|
|
#9
|
|||
|
|||
|
Faylaricia,
could you please edit post no. 4 (when logged in click on edit) and put the [ php ] [ /php ] tags around your php code, it adds syntax highlighting which is a quick way to spot some of the more common mistakes.
__________________
http://www.phptutorials.cjb.net. go on, give it a click! |
|
#10
|
||||
|
||||
|
If it's hanging, it would have to be hanging on the line $results = mysql_query($people) or die(mysql_error());
but you're positive the PEOPLE table is being created? |
|
#11
|
|||
|
|||
|
Quote:
Done. I wondered how everyone did it! |
|
#12
|
|||
|
|||
|
Quote:
Yes, I have three tables: Movie, Movietype and People within wiley |
|
#13
|
||||
|
||||
|
perhaps put a mysql_close() before your 'success' statement?
[this is usually not necessary as PHP will close it by default] Try putting echo statements after each query call... |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Connecting to MySQL is not showing up in php file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|