Computing.Net > Forums > Database > Problem with SQL query, php form

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Problem with SQL query, php form

Reply to Message Icon

Name: Shr0Om
Date: February 21, 2007 at 05:52:38 Pacific
OS: XP
CPU/Ram: amd 64 3200
Product: custom
Comment:

In my db i have a colummn fname where first names are stored. If the name contains a middle name, i wont see whats after the space.

Example:
fname | surname
andrew smith| andersen

When i retrive fname & surname it outputs:
andrew|andersen. So, "smith" is left out.


code snippet for retriving data:
while($row = mysql_fetch_array($result))
{
$id=$row['id'];
$DocDate=$row['DocDate'];
$moddate=$row['moddate'];
$fname=$row['fname'];
$lname=$row['lname'];
}
Now, i know there's nuttin wrong here since i can print $fname and see both "andrew" and "smith"

But when i echo $fname in the form, something goes wrong.

<tr><td>First Name: <input type="text" name="requiredfname" value=<?php echo "$fname"?>>*
</td>

Does anyone know why? And whats the fix?



Sponsored Link
Ads by Google

Response Number 1
Name: Shr0Om
Date: February 22, 2007 at 04:51:32 Pacific
Reply:

I found the solution.. I just had misplaced the " in the html form.


0
Reply to Message Icon

Related Posts

See More


Birthday Problem Whats wrong in the trigge...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: Problem with SQL query, php form

Need help with SQL-query (access) www.computing.net/answers/dbase/need-help-with-sqlquery-access/209.html

sql syntax problem www.computing.net/answers/dbase/sql-syntax-problem/291.html

problem with sql server 2000 DSN www.computing.net/answers/dbase/problem-with-sql-server-2000-dsn/380.html