forms in php?

A

Anonymous

Guest
Hi,
Usually (lol), I make html forms in Dreamweaver and lateron, I try to combine them with php and mysql editiing the code in notepad or similar.

I was wondering, if I could built the tables directly in php. In other words: is it necessary to built tables and then insert php code into the form fields?

Thank you in advance
 
you can use php to echo all the information.

Code:
<?php

echo '<table>'."\n";
echo '  <tr>'."\n";
echo '    <td>'."\n";
echo 'blah blah blah'."\n";
echo '    </td>'."\n";
echo ' </tr>'."\n";
echo '</table>';

?>

is that what you meant?
 
sounds interesting.
now, if you want to put some php instructions into those echoed table fields, you just open/close curly brackets and write code in between? Or how do you embed the field content (which is php too)?

thank you in advance
 
Code:
<?php 
$query = 'select somehting asldfjlj ';
$result = mysql_query($query);
while($myrow=mysql_fetch_row($result))
{
echo '<table>'."\n"; 
echo '  <tr>'."\n"; 
echo '    <td>'."\n"; 
echo 'blah blah blah'.$myrow[0];
echo '    </td>'."\n"; 
echo ' </tr>'."\n"; 
echo '</table>'; 
}
?>
 
That is already something. However, when I use this code, I get as a result a list of all rows in the table, how could I limit them to just the first row, or just the rows that contain 'somethin'?

Thank you in advance
 
Back
Top