Hello

[email protected] (Karl DeSaulniers)
Newsgroups php.db
Message-ID <[email protected]>
Hi I am new to this list.
I am in need of some help or direction.
I am new to php and databases, so forgive me if my request seems too  
simple.

I am making a database if users and have had much success in getting  
it to work however, not all my data is getting shown once I try to  
display results. I am running an INSERT query that inputs data into  
the database from a form. But here is the hiccup. I am asigning the  
form data to a $variable.

Eg:  $Username = $_POST['Username'];

I then run $Username through some checks to make sure it's not an  
injection. After all that I want to insert it into the database. This  
works fine if I use:

$query = "INSERT INTO users (Username, UserEmail, etc)

VALUES ('".$_POST['Username']."', '".$_POST['UserEmail']."', etc)";

And it works if I use

VALUES ('".$Username."', '".$UserEmail."', etc)";

However I have some variables that are not posted from the form and in  
the first example, it does not insert those in the database.

In the second, it will insert them into the database, but when I go to  
display them it is saying there are no records to retrieve. ???? I  
looked at the database in phpMySql and they are there. It will only  
display them in the results page if they had been inserted using  
$_POST. Is this normal?
What is the best way to $_POST a $Variable. Something like $_POST 
[$Username] (which doesn't work).

Any help would be greatly appreciated.
Thanks,

Karl
Design Drumm

Sent from losPhone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.