Can anyone show me how to make a variable that calls the exact value inserted into a table? Because I only know to call from a textbox, like this:
$name = $_POST['txtname'];
$gender = $_POST['txtgender'];
but what would be the codes if I will call the exact inserted value from a table?
$name = ?;
$gender = ?;
thanks in advance.
You can’t get value from a table. Tables are not “input” elements. However you can get a value from “textarea”. See here: http://www.w3schools.com/tags/tag_textarea.asp
Cups
December 30, 2012, 6:33pm
3
Are you talking about values from a HTML table, as @petervasilev suspects, or are you by any chance talking about a database table?
I’m talking about in the database sorry for not mentioning.
By the way, this is my codes:
for ($i=0; $i<sizeof($checkbox);$i++){
$sql2=“INSERT INTO tbltems SELECT NULL , '”.$checkbox[$i].“’ , id FROM tblName WHERE fname = '”.$fname.“’ AND lname = '”.$lname.“'”;
$result2=mysql_query($sql2);
}
Cups
December 31, 2012, 12:51pm
5
Is your question related to your other current post? http://www.sitepoint.com/forums/showthread.php?944934-Subquery-returns-more-than-1-row-on-2nd-insert
If it is not, can you try and describe it a little better – I will be honest, I cannot make sense of this question at all.
Maybe someone else can help?