wmguk Posted September 4, 2008 Share Posted September 4, 2008 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 More sharing options...
wmguk Posted September 4, 2008 Author Share Posted September 4, 2008 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. Link to comment https://forums.phpfreaks.com/topic/122779-loss-of-datatext-upon-an-update/#findComment-633994 Share on other sites More sharing options...
wmguk Posted September 4, 2008 Author Share Posted September 4, 2008 scrub that - i was missing the ' ' ..... Link to comment https://forums.phpfreaks.com/topic/122779-loss-of-datatext-upon-an-update/#findComment-633998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.