Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make sure all content appear on the cell and not just the first word?
    primarykey
    data
    text
    <p>I am having a problem displaying content on a table from mysql table in the database to a form in PHP. My problem is that only the first word show on the address field for example.</p> <p>Please look at my page on: <a href="http://www3.londonmet.ac.uk:8008/~iia0014/employeeManager.php" rel="nofollow">http://www3.londonmet.ac.uk:8008/~iia0014/employeeManager.php</a></p> <p>And also the cells are not aligned with the title.</p> <p>Can anyone help me to solve this? </p> <p>On my css I have:</p> <pre><code>table { table-layout:fixed; width:180%; overflow:hidden; border:1px ; word-wrap:nowrap; text-align:left; } </code></pre> <p>But even if removing the CSS, just the first word appear.</p> <p>PHP CODE:</p> <pre><code>&lt;?php // Connect to server and select databse. $con = mysql_connect("$host","$username","$password"); if (!$con){ die("Can not connect: " . mysql_error()); } mysql_select_db("$db_name",$con); if(isset($_POST['update'])){ $UpdateQuery = "UPDATE employees SET Name='$_POST[name]', DOB='$_POST[dob]', Tel='$_POST[tel]', Address='$_POST[address]', Department='$_POST[department]', PayRate='$_POST[payrate]', Skills='$_POST[skills]', Gender='$_POST[gender]' WHERE EmpNo='$_POST[hidden]'"; mysql_query($UpdateQuery, $con); }; if(isset($_POST['delete'])){ $DeleteQuery = "DELETE FROM employees WHERE EmpNo='$_POST[hidden]'"; mysql_query($DeleteQuery, $con); }; if(isset($_POST['add'])){ $AddQuery = "INSERT INTO employees (EmpNo, Name, DOB, Tel, Address, Department, PayRate, Skills, Gender) VALUES ('$_POST[uempNo]','$_POST [uname]','$_POST[udob]', '$_POST[utel]','$_POST[uaddress]','$_POST[udepartment]', '$_POST[upayrate]','$_POST[uskills]','$_POST[ugender]')"; mysql_query($AddQuery, $con); }; $sql = "SELECT * FROM employees"; $myData = mysql_query($sql,$con); ?&gt; &lt;table border="1" width="10%"&gt; &lt;?php echo "&lt;tr&gt; &lt;th&gt;Number&lt;/th&gt; &lt;th &gt;Employee Name&lt;/th&gt; &lt;th&gt;DOB&lt;/th&gt; &lt;th&gt;Telephone&lt;/th&gt; &lt;th&gt;Address&lt;/th&gt; &lt;th&gt;Department&lt;/th&gt; &lt;th&gt;Pay Rate&lt;/th&gt; &lt;th&gt;Skills&lt;/th&gt; &lt;th&gt;Gender&lt;/th&gt; &lt;/tr&gt;"; while($record = mysql_fetch_array($myData)){ echo "&lt;form action=employeeManager.php method=post&gt;"; echo "&lt;tr&gt;"; echo "&lt;td&gt;" . "&lt;input type=hidden name=hidden value=" . $record['EmpNo'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=name value=" . $record['Name'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=dob value=" . $record['DOB'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=tel value=" . $record['Tel'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=address value=" . $record['Address'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=department value=" . $record['Department'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=payrate value=" . $record['PayRate'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=skills value=" . $record['Skills'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=text name=gender value=" . $record['Gender'] . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=submit name=update value=update" . " &lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=submit name=delete value=delete" . " &lt;/td&gt;"; echo "&lt;/tr&gt;"; echo "&lt;/form&gt;"; } echo "&lt;form action=employeeManager.php method=post&gt;"; echo "&lt;tr&gt;"; echo "&lt;td&gt;&lt;input type=text name=uempNo&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=uname&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=udob&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=utel&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=uaddress&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=udepartment&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=upayrate&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=uskills&gt;&lt;/td&gt;"; echo "&lt;td&gt;&lt;input type=text name=ugender&gt;&lt;/td&gt;"; echo "&lt;td&gt;" . "&lt;input type=submit name=add value=add" . " &lt;/td&gt;&lt;/tr&gt;"; echo "&lt;/form&gt;"; echo "&lt;/table&gt;"; mysql_close($con); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload