Jump to content

Recommended Posts

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

 

O4H37571.jpg

 

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

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]";

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]";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.