$string = mysql_query("SELECT * FROM ".$_SESSION['username']."");
$sql = "INSERT INTO ".$_SESSION['username']." ('".
for($j=0; $j < mysql_num_fields($string); $j++) {
$string1 .= mysql_field_name($string, $j)."', '".;
}
."') VALUES ('".
for($j=0; $j < mysql_num_fields($string); $j++) {
$_POST[mysql_field_name($string, $j)]."', '".
}
"')";
PHP auto generating SQL statement.
Page 1 of 13 Replies - 222 Views - Last Post: 06 February 2013 - 08:27 PM
#1
PHP auto generating SQL statement.
Posted 06 February 2013 - 06:29 PM
I am working on a website that will be for a database, and managing it, through PHP and SQL, I am trying to make it pull down all the column names and place them in the statement, and also get all the $_POST[] data from the textarea's that are named correctly. and it will not work, I'm not sure if I am doing it correctly, this is the first time I have tried to do something like this.
Replies To: PHP auto generating SQL statement.
#2
Re: PHP auto generating SQL statement.
Posted 06 February 2013 - 07:15 PM
never mind, figured it out, you can delete this post now.
#3
Re: PHP auto generating SQL statement.
Posted 06 February 2013 - 07:21 PM
Posts don't get deleted. I will however move it on over to PHP.
#4
Re: PHP auto generating SQL statement.
Posted 06 February 2013 - 08:27 PM
and apparently there is no EDIT feature either.. haha
thank you, im new to the site, and i could not find the PHP section.
thank you, im new to the site, and i could not find the PHP section.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|