Originally posted by Ironmann00
Now you have got me thinking.
🙂
Is it possible to have a variable that reflects all submitted data, but reads them seperatly (by user...say)?
Probably.
Let's say that:
$Display = the info that is submitted by one user.
An array, I suppose ... I follow thus far.
$_Display is already typed into an HTML page.
Which is to say, that a script displays the content of $Display after it's been submitted by a user? OK ...
Each time a user submitted info, $_Display would show what the submitted in the HTML/PHP page.
Yup. I was right, then 🙂
But how could I save the info to a database too? Should I save the HTML/PHP page to the database instead? I will continue to try and make what I am trying to say more clear.
You could break up the array, using perhaps [man]explode/man, and submit each variable to a seperate database column in some database table, for example. You might not even need to explode() it ---
<?php
$sql="insert into sometable (name, email, favefood) values($var[0], $var[1], $var[2])";
$success=mysql_query($sql);
if ($success) {
echo "Saved all info to database!";
}
else {
echo "DB crapped out in somescript, line whatever...";
}
I just started reading the guidelines. I am doing something wrong?
Not necessarily. A lot of questions are maybe less preferable than one well forumulated one. Also, it's good if people will try and learn as much as possible via tutorials, books, the manual, whatever. Also, planetsim did a fairly good job on the FAQ and examples that are sticked at the top of this forum. (BuzzLY's guidelines are ultra-kewl, IMHO...) But I'm not having a problem with your posts. Welcome to PHPBuilder, BTW ... 🙂
Oh, and stolzy, isn't it "Use the Source, Luke!"?? 😃