Can Somebody help me with my PHP project. what I want is to make a database query's result to be randomly distributed to an html table. and then save the whole table in a database just like this.

Query Result
Query Result
Query Result

to

Data Data Query Result
Data Data Query Result
Data Data Query Result

to

DATABASE


I would gladly appreciate your help tnx.

Recommended Answers

All 3 Replies

I don't really understand what you are asking. At best you have defined a requirement. This is a programming forum (but it isn't a place to get your project coded for you). You don't have a programming issue yet because you haven't done any. Write the code and then if you have an issue, come back and ask a specific question. If you don't know how to write the php code (and don't care about learning it), then find a utility to do it or go to a site like Odesk and find someone to code it for you.

Sorry for the newbie post sir. Actually sir I already have a code. I just dont know how to populate a table with the results of the query then that table to be saved in mysql database these are my codes sir.

$query = $query = "SELECT * FROM pointsprof, subject WHERE pointsprof.Total >= subject.IM206"; 
	 
$result = mysql_query($query) or die(mysql_error());

$row = mysql_fetch_array($result) or die(mysql_error());

do {echo '<form action="subjectload.php" method="POST" name="theForm" onsubmit="return validateFormOnSubmit(this)">
  <table width= "200">
    <tr>
      <td><label>
        <input type="radio" name="RadioGroup1" value="'.$row['name'].'" id= "RadioGroup1_0" />
         '.$row['name'].'</label></td><br/>
    </tr> 
  </table>';} while($row = mysql_fetch_array($result)) ?><input type="submit" name="submitType" value="CONTINUE">

I am not entirely sure what you're problem is, but I would do this:

$query = "SELECT * FROM pointsprof, subject WHERE pointsprof.Total >= subject.IM206";
$result = mysql_query($query) or die(mysql_error());

echo '<form action="subjectload.php" method="POST" name="theForm" onsubmit="return validateFormOnSubmit(this)">';

echo '<table width= "200">';

while ($row = mysql_fetch_array($result))
{
  echo '<tr>';
  echo   '<td><input type="radio" name="RadioGroup1" value="'.$row["name"].'" id= "RadioGroup1_0" /></td>';
  echo '</tr>';
}

echo '</table>';
echo '<input type="submit" name="submitType" value="CONTINUE">';

This way everything is in one table and will print out nicely. If you are a little more clear on your problem, maybe I can say a little more.

Hopefully this is helpful! Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.