Jump to content

Archived

This topic is now archived and is closed to further replies.

fireslug

What php script to access and input data to mysql

Recommended Posts

I'm brand new and totaly green to php/mysql and need a little bit of help to get started. If anyone out there is patient and condierate enough to help, I would be eternally grateful

I have at last managed to install Xxamp which allows me to play with mysql and php before uploading to the server. I have created tables in mysql but have no idea of how to access the new DB or indeed, add data to it.

Several DB were included with xxamp. I thought that I could make a few changes to one of the existing php pages so I could access the new DB that I created, but I simply can't get it to work

I can add and change data on the server, but can't do it on my PC. I have screenshot the folder and subfolders to send to anyone who can help by looking at the structure and advising the code to enter into the pgp page.

Ric

Share this post


Link to post
Share on other sites
If you want to use a database. You'll first want to connect to the database and then select the database like so:
[code=php:0]mysql_connect("localhost", "user", "pass");
mysql_select_db("db_name");[/code]

First change user to your mysql username and change pass to the password for the username. Now cahnge db_name to the database you want to use

You have now connected to the database. [url=http://www.php-mysql-tutorial.com/]This site here[/url] provides tutorials on using PHP with MySQL.

Share this post


Link to post
Share on other sites
Also try [url=http://php.net/mysql]here[/url] for other mysql functions.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.