Using this code it will generate a short list from my database
<?php
mysql_connect('localhost','root','');
mysql_select_db("clients");
$fname = $_POST['firstname'];
$SQL = "SELECT * FROM members WHERE firstname = '$fname'";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
print $db_field['firstname'] . "<BR>";
print $db_field['lastname'] . "<BR>";
print $db_field['email'] . "<BR>";
print $db_field['date'] . "<BR>";
echo $db_field['firstname'];
}
?>
but I need to be able to use the values its pulled out later down in the page.
if I try to use echo $db_field['firstname']; somewhere else on my page it just leaves a blank spot...
I tried doing this:
<?php
mysql_connect('localhost','root','');
mysql_select_db("clients");
$fname = $_POST['firstname'];
$SQL = "SELECT * FROM members WHERE firstname = '$fname'";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
$name = print $db_field['firstname'] . "<BR>";
$lname = print $db_field['lastname'] . "<BR>";
$mail = print $db_field['email'] . "<BR>";
$day = print $db_field['date'] . "<BR>";
echo $db_field['firstname'];
}
?>
and then using echo $thevariable i wanted but that didnt work either...
thanks
Extra fields in main body and php required.
I'm new to PHP so please be gentle. I have a little php script below that works well. The "$msgVar" goes into the body message of the email. How can I effect additional fields that can be
Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that I can base everything off one root and work with that, but I'm having a problem with popups
Data type mismatch
Hi, I am migrating data from algol to c.I mapped real datatype in algol to double datatype in c.real has 6 bytes storage.i got one formula in unisys manual which is about the internal representation
Change Web page language
i doing this thing first time but i dont find any suitable solution for it. On the demand of user. I want to change my web site pages in user's language without without google translater. Can
PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26 in total. I have a PHP page which will list all server names with a link on the page and when you
$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable, but it doesn't work:Code: $test = array(1,2);$num = "[0]";echo $test{"$num"};
Sendmail.php - heading error following check_input
Hi,I would greatly appreciate some help? I am brand new to PHP and have been searching and editing code ALL day :shrug:yet I still cannot find the reason for this error in my Sendmail.php
array empty
Hiya peeps,Ok here is the codes.order.phpCode: <?php if(!isset($_POST) OR empty($_POST)) { echo
How to search for several parameters from objects in a database?
I have a database with lots of information about objects.Now I would like to search for 4 or 5 parameters at the same time (from a form) like this:I choose from a select-box one parameter and then
formating when pulling data from a mysql databaseOk so Im not to sure if this is the right thread to post in but here is my catch 22 issue.I have a test web page www.aandstech.com.au/test.phpTest.php pulls its content from a my sql table.This works