phpMyAdmin 2.2.6 & MySQL 4.0.1

10-27-03, 06:02 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
|
|
|
phpMyAdmin 2.2.6 & MySQL 4.0.1
Has anyone used either of these on their own PC? I've downloaded both, plus PHP, onto a WinXP personal PC, and one or the other isn't running properly. phpMyAdmin isn't showing new user permissions when I set them. If I add a new database, add a table and insert info, the dropdown database list won't show all the databases at first, then when it does it'll say that a database (which I just populated) has no tables or info. I'm using these with Apache, not as a server but for my own script writing (learning php/mysql, mostly). PHP seems to be running fine. Any sugggestions what might be going on, or how to fix this? (By the way, this was a program from FoxServ, and I have yet to get a response for help on their support forum).
Thnx
|

10-30-03, 11:23 AM
|
 |
Community VIP
|
|
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
|
|
You have to go into the config file of myphpadmin and specify the username and password you have set for root access to your mysql. There are 2 different places in that config file that you have to specify the username and password for root access in. Once you do that, it should give you permission. I hope this helps.
Quote:
|
Originally Posted by mdhall
Has anyone used either of these on their own PC? I've downloaded both, plus PHP, onto a WinXP personal PC, and one or the other isn't running properly. phpMyAdmin isn't showing new user permissions when I set them. If I add a new database, add a table and insert info, the dropdown database list won't show all the databases at first, then when it does it'll say that a database (which I just populated) has no tables or info. I'm using these with Apache, not as a server but for my own script writing (learning php/mysql, mostly). PHP seems to be running fine. Any sugggestions what might be going on, or how to fix this? (By the way, this was a program from FoxServ, and I have yet to get a response for help on their support forum).
Thnx
|
|

10-30-03, 12:15 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
|
|
OK, I made some changes. I went to phpMyAdmin 2.5.3, and MySql 4.0.16. phpMyAdmin seems to be fine. If I use phpMyAdmin, I can create db's, tables, and insert info with no problem. If I use a form to add the info and submit to a php script to run an insert query, all that happens is the id field (auto-increment) gets added, but no other fields...and it gets added twice, both entries with successive id numbers. Example..
Add info to a form, the insert result is
id field, name field, city field, state field
1 blank blank blank
2 blank blank blank
Also, in winmysqladmin, it is saying in the ODBC window that Driver 3.51 cannot be found.
I'm also using Apache 2.0.47 and PHP 4.3.3.
|

10-30-03, 12:33 PM
|
 |
Community VIP
|
|
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
|
|
Well, you got the myphpadmin fixed. That's a good first step. 
Can you copy and paste the code you are trying to use to insert info into the tables? That way it will be easier to troubleshoot it.
|

10-30-03, 01:27 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
|
|
Heres the input form...
<form action=insert.php method=post>
Your bands name<br>
<input type=text name="bandname" size=30><br>
Your City<br>
<input type=text name="city" size=30><br>
Your State<br>
<input type=text name="state" size=30><P>
<input type=submit name="Submit" value="Add to the BandBook"><br>
<input type=reset name=reset value="Erase and start over">
</form>
And the insert query....
php
include("dbinfo.inc.php");
$dbh=mysql_connect ("localhost", "$username", "$password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("$database") or die ("Couldn't select database");
$query = "INSERT INTO bandbook VALUES ('','$bandname','$city','$state')";
mysql_query($query) or die(mysql_error());
$result=mysql_query($query);
mysql_close();
/php
"dbinfo.inc.php" is an include for the connection to the db.
|

10-30-03, 03:42 PM
|
 |
Community VIP
|
|
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
|
|
Well, it is definately your syntax. Here is a nice example on how to connect and insert values into a MySQL table. Try running this script and see if it still gives you an error:
|

10-30-03, 05:59 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
|
|
Well, that did work, so I know that info can go into the db from an insert query script. But I still have the problem that the info put into the form is not, for whatever reason, being added to the insert query. This is the main problem, as I want toset this up so I dont have to "hard code" the info into the insert each time I want to add info to the table.
|

10-30-03, 07:33 PM
|
 |
Community VIP
|
|
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
|
|
Use the above example as a template, and build your script on it. You will first need to create a TABLE in your database. For example:
Quote:
|
Originally Posted by mdhall
Well, that did work, so I know that info can go into the db from an insert query script. But I still have the problem that the info put into the form is not, for whatever reason, being added to the insert query. This is the main problem, as I want toset this up so I dont have to "hard code" the info into the insert each time I want to add info to the table.
|
|

10-30-03, 08:44 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
|
|
I can already set up the tables and fields thru phpMyAdmin. I finally found the only way I could get the form inputs to pass to the insert query was by using _POST at the beginning of the query.
//php
$bandname=$_POST['bandname'];
$city=$_POST['city'];
$state=$_POST['state'];
$location = "localhost";
$username = "username";
$password = "password";
$database = "bandmatch";
$conn = mysql_connect("$location","$username","$password") ;
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$query = "INSERT INTO bandbook(id,bandname,city,state) VALUES('','$bandname','$city','$state')";
$result=mysql_query($query);
mysql_close();
echo header ("Location: thanks.html");
//php
Don't know why this is the only way the setup will work, possibly something in the configuration of my PHP or mysql. Thnx for the suggestions.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|