I'm a newbie at this so please bear with me: I'm populating a text box with the value of a variable but it seems that all I'm getting in the text box is the variable's value up to the first space. Example: if my variable's value is "WEST END", all that's showing up in my text box is 'WEST". Here's the strange part (strange to me anyway): within the same php code, I can echo the variable's value and it returns the whole thing, not just up to the first space. What gives?
My code:
<html>
<head><title>Edit Southware Customer Information</title></head>
<body>
<?php
$cust=$_POST['list1'];
//echo "cust: $cust";
// connect to db
$conn = mysql_connect('localhost','root') or trigger_error("SQL", E_USER_ERROR);
$db = mysql_select_db('sw_customers',$conn) or trigger_error("SQL", E_USER_ERROR);
$sql = "select custName, contact, address1, address2, address3, city, state, zipcode, custPhone, custFax, contractNum, rev, userCount,
productCode, productKey, serialNum, custAuth, prodAuth, licenseNum, installPath from customer_info where custName like '$cust'";
$result = mysql_query($sql, $conn) or trigger_error("SQL", E_USER_ERROR);
$row = mysql_fetch_array($result);
echo "<form method=post>";
echo "<table border=1, cellpadding=1, cellspacing=1>";
// echo "row: $row[custName]<br/>"; // this line, when enabled, returns the
[INDENT][/INDENT]full value of my variable
// these next lines are the lines I'm having trouble with
echo "<tr><td>Customer Name</td><td><input type=text name=custName value=$row[custName]></td></tr>";
echo "<tr><td>Contact</td><td><input type=text name=contact value=$row[contact]></td></tr>";
echo "<tr><td>Address Line 1</td><td><input type=text name=address1 value=$row[address1]></td><tr/>";
echo "<tr><td>Address Line 2</td><td><input type=text name=address2 value=$row[address2]></td><tr/>";
echo "<tr><td>Address Line 3</td><td><input type=text name=address3 value=$row[address3]></td><tr/>";
echo "<tr><td>City</td><td><input type=text name=city value=$row[city]></td><tr/>";
echo "<tr><td>State</td><td><input type=text name=state value=$row[state]></td><tr/>";
echo "<tr><td>Zipcode</td><td><input type=text name=zipcode value=$row[zipcode]></td><tr/>";
?>
</form>
</body>
</html>[/COLOR]
Again, I'm a newbie at this so I'm sure you'll see things in my code that could be done better. Thanks for any help!