Jump to content

loss of data/text upon an update


wmguk

Recommended Posts

Hey,

 

I have a drop down select on a form, and the info is passed using POST.

 

The correct info is in the form however when I click submit, the update script only uses the first word, and not the whole string.

 

For Example - the form has "Web Design / Hosting" however when it hits the database it is just "Web"

 

how can I pass the full string?

 

this is the update script

 

$industry = $_POST['industry'];

$sql = "UPDATE users SET email = '$email' , coname = '$coname' , name = '$name', address1 = '$address1' , address2 = '$address2' , town = '$town' , county = '$county' , postcode = '$postcode' , tel = '$tel' , web = '$web' , password = '$password' , industry = '$industry' WHERE refnum = '$refnum'";

Link to comment
https://forums.phpfreaks.com/topic/122779-loss-of-datatext-upon-an-update/
Share on other sites

I just did an echo of $industry and for some reason that is only sending Web

 

this is the code that generates the drop down with industry in

 

include "scripts/connection.php";  
if (!$con)  
{  
  die( 'Could not connect: ' . mysql_error() );  
} 
mysql_select_db($db, $con); 

$sql = "SELECT * FROM industry WHERE used = '0'"; 

$result = mysql_query( $sql ) or die( "<strong>Query Error</strong>: " . mysql_error() . "<br><strong>Query</strong>: $sql<br><br>" ); 
  
while($row = mysql_fetch_array($result)) 
{ 
			echo "<option value=". $row['industry'] . ">". $row['industry'] . "</option>";
} 

 

and on viewing the html page the full information is pulled out (Web Design / Hosting) however between here and the next page it loses the rest after the whitespace.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.