Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,171,692 members, 7,882,337 topics. Date: Saturday, 06 July 2024 at 10:22 PM

How Can I Link A Form In My Website To A Table In My Database - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How Can I Link A Form In My Website To A Table In My Database (2253 Views)

Will This Likely Overload My Server Or Crash My Database? / How Do I Link A New Domain Name To An Existing Hosting Account? / Please How Can I Link A Domain Name To A Site I Developd With Bluevoda (2) (3) (4)

(1) (Reply) (Go Down)

How Can I Link A Form In My Website To A Table In My Database by azenas: 6:58pm On Mar 28, 2013
Goodday everyone in the house. kindly assist me. i need help on how to link a sign up form on my website to a table in my database using the PHP codes. so that user will be able to choose a username and a password by themselves. I have been able to create a connection between the website and the database, but i couldn't go beyond that. thanks
Re: How Can I Link A Form In My Website To A Table In My Database by Afam4eva(m): 7:37pm On Mar 28, 2013
Let's see what you've done so far so that we can help you complete it.
Re: How Can I Link A Form In My Website To A Table In My Database by talk2me006(m): 8:13pm On Mar 28, 2013
paste your code to see how we will be of help
Re: How Can I Link A Form In My Website To A Table In My Database by Startechng: 10:07pm On Mar 28, 2013
What if he only created database nd tables without having any idea of the insert.php codes?

I think what he needs to paste here is the table contents and the form code then we could create you the insert.php that validates, checks logins, sessions etc.
Re: How Can I Link A Form In My Website To A Table In My Database by azenas: 6:13pm On Mar 29, 2013
@startech and @afam4real. i actually created the database from phpmyadmin and the website from dreamwaver8 and i av been able to connect to mysql server using this code
<?php
$username = "AZENAS";
$password = "";
$hostname = "localhost";

//connection to the database
$dbhandle = mysql_connect($locahost, $AZENAS, $dbpass)
or die("Unable to connect to MySQL"wink;
echo "Connected to MySQL<br>";
?>

but i couldnt go beyond that.

the database name is "forum" and the table name is "member"
Re: How Can I Link A Form In My Website To A Table In My Database by azenas: 6:19pm On Mar 29, 2013
@startech and @afam4real. i actually created the database from phpmyadmin and the website from dreamwaver8 and i av been able to connect to mysql server using this code
<?php
$username = "AZENAS";
$password = "";
$hostname = "localhost";

//connection to the database
$dbhandle = mysql_connect($locahost, $AZENAS, $dbpass)
or die("Unable to connect to MySQL"wink;
echo "Connected to MySQL<br>";
?>

but i couldnt go beyond that.

the database name is "forum" and the table name is "member"
it contains fields like Display name:, E-mail, password, password retype, gender, and phone number

what i want to achive is link dis form to the database so that when user registers, there information is automatically stored in the database and they can login from the log in page. just like facebook and yahoo.
Re: How Can I Link A Form In My Website To A Table In My Database by solutions247(m): 9:52pm On Mar 29, 2013
since you av created the table in d database with the fields. You wil go to dreamweava n create a page kaled register.php dere you wil need to build d page wit php codes if you know php or rather i wil advice u go n download videos on how to build a registration page dere u wil b taught how to code it if only u undastand dos codes 4rm line 1 to d ending.Goodluck on ur way 2 programing
Re: How Can I Link A Form In My Website To A Table In My Database by Startechng: 4:31am On Mar 30, 2013
Ok, it seems u re through with the html aspect of it already... Now its time for u to do some programming... Like someone suggested use google, get some video tutorials, there u will learn how to write the register.php nd the insert.php codes.. U may want to give it to an expact to do this for you cos u dont want to write un-safe codes to aviod hackers.
Re: How Can I Link A Form In My Website To A Table In My Database by hfally: 8:37pm On Nov 01, 2016
you are making mistakes from your first query..

Correct one is:

<?php
$username = "AZENAS";
$password = "";
$hostname = "localhost";

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)

//if connection is or isn't successful
if(!$dbhandle){
die( "Unable to connect to MySQL - ".mysql_error() ) ;
}else{
echo "Connected to MySQL";
}
?>

(1) (Reply)

Browser Compatible Code: How To Style An Html Select Box To Omit Drop Down Arrow / Jazzyfans On Attempt Of Being Hacked / Can You Design This Simple Reservation Form?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 21
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.