Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.