Jump to content

Problem.Please Help!


Sturm

Recommended Posts

hello everybody.i have a couple of problems that need urgent solving.first of all- I AM A TOTAL NOOB at PHP!

 

how can i make information from a submit button e.g.

 

 

| 0123456789 | test1| 2007-99-99|  |SUBMIT|

 

get written in a table that is in my MySQL.Please write the code and where i have to replace stuff.

                                                 

 

Link to comment
https://forums.phpfreaks.com/topic/53164-problemplease-help/
Share on other sites

You question is pretty vague (You dont tell us any database structure), and were not really here to supply code, but to help with your code.

 

You need to look at the mysql_query and its related functions.

 

Failing that... search for some tutorials. There is a good one in my signiture that covers PHP basics.

Link to comment
https://forums.phpfreaks.com/topic/53164-problemplease-help/#findComment-262643
Share on other sites

As thorpe said, we're not here to write code for you. We are more than happy to help, as that is what this forum is for.

 

You have to walk before you can run. Here is a sample snippet of code. I use this to insert 2 fields into a db

 

<?php
        $testname=$_POST['testname']; // get field named testname
$number_questions=$_POST['number_questions']; //get filed named number_questions
connectdb(); // initiate a connection to the db
$query="INSERT INTO tests (testname,questions)VALUES('$testname','$number_questions')"; //set up the query
$result=mysql_query($query); //run the query
?>

 

Take a look at the manual, and look over some tutorials. Start writing some code. If you run into problems, post in this forum and your sure to get help.

Link to comment
https://forums.phpfreaks.com/topic/53164-problemplease-help/#findComment-262791
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.