I am a complete MySQL/php newbie. I have created a form using phpFormGenerator and opted to deliver it to a mySQL Db that I have already set-up on my webhosts server. I believe I have successfully entered the correct hostname, database name, tablename and username in the phpFormGenerator boxes.
However, it says it will ask me for my password later - it never did! I have checked the generated php files and did find one place to enter a value for my password in install.php. However, having entered my password there, I am still recieving the following errors when I click submit on the form:
Warning: include(config.inc.php) : failed to open stream: No such file or directory in /home/y09dann/public_html/form208867/processor.php on line 5
Warning: include(config.inc.php) : failed to open stream: No such file or directory in /home/y09dann/public_html/form208867/processor.php on line 5
Warning: include() : Failed opening 'config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/y09dann/public_html/form208867/processor.php on line 5
Warning: mysql_connect() : Access denied for user 'y09dann'@'localhost' (using password: NO) in /home/y09dann/public_html/form208867/processor.php on line 6
Could not connect to database: Access denied for user 'y09dann'@'localhost' (using password: NO)
Where do I enter my mySQL password in the files generated by phpFormGenerator? Presumably it needs to be entered somewhere?
I can see that I still need to set-up the 'config.inc.php' file, which is the second part of my problem…..I have myphpadmin installed on my hosts server aswell and have created the table with fields corresponding to my form. However, IF I manage to work out how to create the config.inc.php file I have no idea where I am meant to put it. Do I place it in the same folder as the phpFormGenerator generated form files? Is this more of a question for my hosting company?
My form is very basic (I am just trying to learn how post simple form data to a mySQL dbase), only 3 fields for the time being. If anyone can give me some help or advice with any of my problems I would be very appreciative!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Line 5 reads something like this:
include('config.inc.php');
I ususally change it to something like
include('admin/config.inc.php');
Then I protect teh admin folder with a password so that nobody can see the file without the password.
In any case the config.inc.php file should look like this:
<?php
$db_host="";
$db_user="";
$db_pass="";
//and any other variable needed to support your db connection
?>
The variable names need to match those used in your process.php file.
Look for a line like this:
$link = mysql_connect($db_host,$db_user,$db_pass);
Use these names and assign the value appropriate for your db connection.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Many thanks for your quick response. I have managed to create the config.inc.php file with all the variables you suggested. I then tested the form and it all seemed to work - I was directed to my confirmation page.
However, when I checked my db via phpMyAdmin, the table was empty still. I think I have noticed in the install.php that there is a line to create the table. However, I had already created the table previously via phpMyAdmin (and even tried adding the table name to the config.inc.php file with $db_table="mytablename"; but to no avail.
Should I let the table be created by the install.php file? Or am I missing something else? I have made sure the field names are identical to the generic field names generated by phpFormGenerator (i.e. field_1, field_2 etc). I have set them all as text fields, just like they are on the form. There is something called 'collation' in the table which is set to "latin1_general_ci" - but I don't think this would have anything to do with it, would it?
I am sure it is something very simple and I hope with a bit of messing about I may find it, but any pointers in the meantime would be most welcome!
Thanks,
Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am a complete MySQL/php newbie. I have created a form using phpFormGenerator and opted to deliver it to a mySQL Db that I have already set-up on my webhosts server. I believe I have successfully entered the correct hostname, database name, tablename and username in the phpFormGenerator boxes.
However, it says it will ask me for my password later - it never did! I have checked the generated php files and did find one place to enter a value for my password in install.php. However, having entered my password there, I am still recieving the following errors when I click submit on the form:
Warning: include(config.inc.php) : failed to open stream: No such file or directory in /home/y09dann/public_html/form208867/processor.php on line 5
Warning: include() : Failed opening 'config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/y09dann/public_html/form208867/processor.php on line 5
Warning: mysql_connect() : Access denied for user 'y09dann'@'localhost' (using password: NO) in /home/y09dann/public_html/form208867/processor.php on line 6
Could not connect to database: Access denied for user 'y09dann'@'localhost' (using password: NO)
Where do I enter my mySQL password in the files generated by phpFormGenerator? Presumably it needs to be entered somewhere?
I can see that I still need to set-up the 'config.inc.php' file, which is the second part of my problem…..I have myphpadmin installed on my hosts server aswell and have created the table with fields corresponding to my form. However, IF I manage to work out how to create the config.inc.php file I have no idea where I am meant to put it. Do I place it in the same folder as the phpFormGenerator generated form files? Is this more of a question for my hosting company?
My form is very basic (I am just trying to learn how post simple form data to a mySQL dbase), only 3 fields for the time being. If anyone can give me some help or advice with any of my problems I would be very appreciative!
Line 5 reads something like this:
include('config.inc.php');
I ususally change it to something like
include('admin/config.inc.php');
Then I protect teh admin folder with a password so that nobody can see the file without the password.
In any case the config.inc.php file should look like this:
<?php
$db_host="";
$db_user="";
$db_pass="";
//and any other variable needed to support your db connection
?>
The variable names need to match those used in your process.php file.
Look for a line like this:
$link = mysql_connect($db_host,$db_user,$db_pass);
Use these names and assign the value appropriate for your db connection.
Hi TNT,
Many thanks for your quick response. I have managed to create the config.inc.php file with all the variables you suggested. I then tested the form and it all seemed to work - I was directed to my confirmation page.
However, when I checked my db via phpMyAdmin, the table was empty still. I think I have noticed in the install.php that there is a line to create the table. However, I had already created the table previously via phpMyAdmin (and even tried adding the table name to the config.inc.php file with $db_table="mytablename"; but to no avail.
Should I let the table be created by the install.php file? Or am I missing something else? I have made sure the field names are identical to the generic field names generated by phpFormGenerator (i.e. field_1, field_2 etc). I have set them all as text fields, just like they are on the form. There is something called 'collation' in the table which is set to "latin1_general_ci" - but I don't think this would have anything to do with it, would it?
I am sure it is something very simple and I hope with a bit of messing about I may find it, but any pointers in the meantime would be most welcome!
Thanks,
Matt
I've figured it out!
I added the following variables to the config.inc.php file and all seems to be working correctly.
Until my next issue…adios and many thanks for you time and effort…