|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
MySql help
Hey all.
At the moment i'm trying to make a script that posts news, and saves the data on a mysql db. basically, i need to know how to use a form to submit infomation into a database. And also, a good method for creating Mysql tables without using a tool like phpMyAdmin. Any surgestions? - Thanks guys & gals |
#2
|
||
|
whatever you gave the form in the name field is what you can use,
If ($_POST['postnews']) { $newsbody = $_POST["newsbody"] $newstext = $_POST["newstext"]; //add to mysql manipulate the data as needed etc etc } In this case the form name was postnews and the fieldnames were newsbody and newstext. As for the table a way is to just use a mysql query mysql_query("CREATE TABLE tablename (all column details here); |
#3
|
||
|
if your confused totally on how to insert data from forms:
mysql_query("INSERT INTO db ('dbvalue','dbvalue','dbvalue') VALUES ('$form','$form','$form')"); or some times you'll get a error with that so u neeed to go mysql_query("INSERT INTO db('$form','$form','$form')"); -- it skips picking the column or row or whatever it's called and what order the data will be inserted in , and instead just inserts the data into it 1 by 1 so if id was first the the first $form would go in it. |
#4
|
||
|
thnx guys, that helped alot
- Warm regards |
#5
|
|||
|
Quote:
|
#6
|
||
|
Oh lol, i'm glad i didn't use exactly that, i'll show u the script as soon as it is finished
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MySQL 5.0 is out! | DevilDog#1 | Web design and Programming | 4 | 01-14-2006 07:16 PM |
mysql 4.1 | King | Web design and Programming | 6 | 02-06-2005 12:49 PM |
MySql Help | -DFO-Ironic | Web design and Programming | 6 | 08-01-2004 10:16 PM |
mysql help | G.I.JOE*MFA* | Tech Support | 1 | 07-20-2003 09:22 PM |
MySQL | Kip Kilagan | Web design and Programming | 3 | 04-05-2003 10:34 AM |