Inserting single records to my database...

darylcarpo

New Member
Messages
21
Reaction score
0
Points
0
Need to know does any know how to insert a records to my datase? Need help 'coz I dont know honestly.:happysad:
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
If you are using PHP and MySQL...
you must login to your SQL using

$mysqli=mysqli("localhost","username","password","databasename");
then create a query string like...

$query = "INSERT INTO tablename (integer_field, varchar_field)
VALUES (1,'This is a string.')";

then do a query...
$res = mysqli_query($mysqli,$query);

then never forget to close your mysqli connection to free up overhead.

mysqli_close($mysqli);

This is a simple and generic formula I am not really sure if my syntax is correct but it should point you to the right direction.
if you need more help please do not hesitate to post again and if you need a more specific answer please post more information regarding what you really want to achieve.
 
Top