Jump to content

[SOLVED] php mysql insert


dezkit

Recommended Posts

well all i need is so i can insert something into a table with a form.

 

index.php

<form action="db.php" method="post">
<table border=0>
<tr>
<td>Steamid
<td><input type="text" name="steamid" id="steamid">
<tr>
<td>Access flags
<td><input type="text" name="accessflags" id="accessflags">
<tr>
<td>Account Flags
<td><input type="text" name="accountflags" id="accountflags">
<tr>
<td colspan="2" align="right"><input type="submit" value="Submit">
</form>
</table>

 

 

db.php

<?php
// Make a MySQL Connection
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("1337bunnies") or die(mysql_error());

// Insert a row of information into the table "example"
mysql_query("INSERT INTO users 
(steamid, accessflags, accountflags) VALUES('$steamid', '$accessflags', '$accountflags' ) ") 
or die(mysql_error());  

echo "Data Inserted!";

?>

 

 

whenever i fill out the form and i look into phpmyadmin, its blank. i don't know, but i think im doing wrong stuff with the varchar and what not. here is the format.

 

steamid = "STEAM_0:0:123456"

accessflags = "abcdefghijklmnopqrstuvwxyz"

access = "de"

Link to comment
https://forums.phpfreaks.com/topic/100864-solved-php-mysql-insert/
Share on other sites

Archived

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

×
×
  • Create New...

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.