PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You've got two inputs with name="job" and they're in separate forms. If you're wanting the value from the select list you need to set a value in the option too. Try something like this:
will only display Project_Name, Java, Team_Work and Leadership
How can I get it to display all the records? Because if another record is added to the database I wil have to alter my code. Is there any way of doing this dynamically, so if a new record got added, then it will display in the relevant page without any extra coding?
$query1 = "SELECT * FROM Job_Spec WHERE Project_Name ='$getjob'";
$result1 = mysql_query($query1)
or die ("Couldn't execute query.");
while ($row1=mysql_fetch_array($result1)){
$name1=$row1['Project_Name'];
$skill1=$row1['Java'];
$skill2=$row1['Team_Work'];
$skill3=$row1['Leadership'];
$skill4=$row1['Communication'];
$skill5=$row1['Problem_Solving'];
Right now the above is displayed in Table format, and it works fine, but what if I was to add another field?
For example Cooking, then I would physically have to go into the code and create another array, for example, $skill6=$row1['Cooking'];
Is there anyway that this process can be taken out?
To the best of my knowledge it sounds like you'll have to get your fingers dirty. It would be pretty complicated to make it load info from undefined columns, but it's certainly not impossible. If you really don't like going back in to edit the code maybe you could check out some info on 'SHOW COLUMNS' for mysql and compare the result to an array of existing columns. But I think your best bet is manual labor!