mr.web_developer Posted April 16, 2011 Share Posted April 16, 2011 Hi all Good morning / night / afternoon I have a duplication problem when I need to print my records in PHP First of all let's see the database table As you can see the duplication happened duo to the approvers that mean if there is only one approver there will be no duplication For example when I want to pint request number 1 it will print 1 - Cris - Hadi 1 - Cris - Jack but I want it to be like this 1 - Cris - Hadi,Jack and thank you for your time Link to comment https://forums.phpfreaks.com/topic/233878-problem-php-with-database/ Share on other sites More sharing options...
OGirly Posted April 16, 2011 Share Posted April 16, 2011 Are you talking about when you put the data into the database, or retrieve it. If retrieve, maybe this? (php and mysql...you can adjust etc.) $Requster_Name = "Cris"; $query = mysql_query('SELECT Request_Approvers FROM table_Name WHERE Requster_Name = $Requster_Name'); $approvers = mysql_fetch_array($query); echo "$approvers[0]" ."$approvers[1]"; Link to comment https://forums.phpfreaks.com/topic/233878-problem-php-with-database/#findComment-1202266 Share on other sites More sharing options...
mr.web_developer Posted April 16, 2011 Author Share Posted April 16, 2011 I want to print only 1 record for each request with all aprovers I'm using Oracle but I did try it. It doesn't work see $Requster_ID = '1'; $s1 = oci_parse($c, "select SIG.Requster_ID, SIG.Requester_Name,SIG.APPROVERS from RequestT SIG where SIG.Requster_ID = '$Requster_ID' "); oci_execute($s1); $res1 = oci_fetch_array($s1, OCI_ASSOC); echo "$res1[0]" . "$res1[1]"; Link to comment https://forums.phpfreaks.com/topic/233878-problem-php-with-database/#findComment-1202269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.