Hi i have created an static table having from,subject,date etc and i am just able to display
i have created inbox in the front end how to link.....these table to inbox...i have this code but what is this fuction getdata.....how to proceed just help me pls......

<?
function getdata($tble,$field,$whr) {
       $q="SELECT $field FROM $tble where $whr";
       $res=mysql_query($q);
       $r=mysql_fetch_array($res);
       return $r[0];
       }
     $msgcount=getdata("messages","count(*)","status=0");?>
     <a href="inbox.php?read" >inbox(<?=$msgcount; ?>)</a>

This is a generic function to return a specific field ($field) from a table ($tble) in a MySQL database. The exact record returned is specified by the parameter $whr.

So your call:

$msgcount = getdata("messages", "count(*)", "status=0");

will result in the parameter $msgcount being the result of the following sql query:

SELECT count(*) FROM messages WHERE status=0

In other words, the number of messages where the field status=0.

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.