Jump to content

getting started on MySQL and ....


dina

Recommended Posts

Hi, I want to know a few basic things about using MySQL in a PHP environment, but I don't know where to start:

 

I want to make a form on the website and then save all that info of the form in my db (MS Access) that are ofline on my hard drive.

 

I have a PHP site.

 

Where does MySQL come in on this.

 

Can I link the two and where do I start ? :/

 

I'm pretty sure it is very easy, I just missing something.

 

Thank you

Link to comment
Share on other sites

MySQL is a special type of database which most people use with PHP forms. I've never seen a form linked to a MS Access database.

 

Stefan has some PHP tutorials (links at top right of this page) and I have a basic tutorial here:-

http://w ww.wickham43.net/formphptomysql.php

but it can get complicated and security issues probably need further coding.

 

The MySQL data can be exported in a number of formats including Excel but I'm not sure if it can be exported to Access but I wouldn't be surprised if it could.

Edited by Wickham
Link to comment
Share on other sites

you don't need the access database, the mysql database is used instead(however you can import the access records into a mysql database if your export it as csv and use phpmyadmin to import it into your mysql database.

 

To use a form with a mysql database you need to

 

make a mysql connection:

 

<?php

// db settings

$db_host = "mysql.yourhost.com";

$db_user = "username";

$db_pwd = "password";

$db_name = "database";

mysql_connect($db_host, $db_user, $db_pwd);

mysql_select_db($db_name);

?>

 

you then need to assign a variable to each form feild:

 

 

 

 

 

 

You then need to handle the data:

<?php

if (isset($_POST['Submit'])) {

$info = $_POST['info'];

mysql_query("INSERT INTO `yourtable` (info) VALUES ('$info')");

}

?>

Link to comment
Share on other sites

you can export / import between mysql and access so you can use access offline and mysql online, however one may not be as upto date as the other etc..

 

you can't use mysql offline, so you would be limitted to access, which is better used with asp, not php.

 

php and mysql go together but only online.

 

asp and access go together and you can use access offline.

 

HOWEVER:

 

You could run the mysql database for both the customer with the website front end, and have a seperate admin website which is password protected for the company to use the data, however it would require an internet connection.

 

On the other hand if the database is only to be accessed by the company, then you could have you own mysql server and access it locally (you would need to speak to your IT dept about this).

 

either could be done with php/mysql or asp/access, so depends which way you want to do it.

Edited by sjhwebdesign
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...