Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate a table from sql

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
I have searched but have not found an example.

I need to build a table which populates from a call to abackend table via sql.

I am not all that familiar with php so does anyone have an example I can modify for my needs?

I figure it would be somthing like

<table>blah blah blah
<?php
sql = select blah blah
loop
for i = something something
<tr> blah blah
end loop
?>
</table>


Any help appreciated...
 
You are on the right path,

Also you should use the Search facility in this Forum, as there are alot of examples:






Also check the php online manual at php.net
for [blue]mysql_result, mysql_fetch_array, and mysql_fetch_asoc[/blue] functions in PHP.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Code:
// Free resultset
mysql_free_result($result);

// Closing connection
mysql_close($link);

What does this do?

Is it necessary?
 
Basically its a way to celan up after using the Db. it frees memory taken up by query results, and it closes the connection to the Db freeing server resources for other connections.

PHPManual said:
mysql_free_result() will free all memory associated with the result identifier result.

PHPManual said:
mysql_close() closes the non-persistent connection to the MySQL server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is used.

Also check the user supplied commetns for more information, at the bottom of each page.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top