Link to home
Start Free TrialLog in
Avatar of Richard Teasdale
Richard TeasdaleFlag for United Kingdom of Great Britain and Northern Ireland

asked on

making use of php data

Hi
I have a php query against mysql that returns two fields from a delivery database - print and route.
These I can get to display in a table - per attached code.
However I need to be able to manipulate the data - specifically concatanate the two fields (converting the print to string). This is because there is a delivery note in pdf that is made up of these two fields concatanated. ie 'printroute.pdf'. If I can get this I can print the delivery note simply by calling that order .
Can php do this?

Thanks!
<?php
?>
<html>
<head><title>Schedule</title></head>
<body background="cream.jpg">

<link rel="stylesheet" href="schedule.css" type-"text/css">
<?php
  $user="clayton";
  $host="localhost";
  $password="******";
  $database = "******";
  $cxn = mysqli_connect($host,$user,$password,$database)
         or die ("couldn't connect to server");
  $query = "SELECT print, route FROM DELARCH WHERE orderno = 742695";
  $result = mysqli_query($cxn,$query)
            or die ("Couldn't execute query.");


  /* Display results in a table */
  {
   /* Display results */
     echo "<table border='1'><thead><tr>";
     $finfo = mysqli_fetch_fields($result);
     foreach($finfo as $field)
     {
        echo "<th>".$field->name."</th>";
     }
     echo "</tr></thead>
           <tbody>";
     for ($i=0;$i < mysqli_num_rows($result);$i++)
     {
        echo "<tr>";
        $row = mysqli_fetch_row($result);
        foreach($row as $value)
        {
           echo "<td>".$value."</td>";
        }
        echo "</tr>";
     }
     echo "</tbody></table>";


  } 

?>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of darren-w-
darren-w-
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Chad Smith
Chad Smith
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Teasdale

ASKER

Thanks to you all for prompt answers!
IMore than enough to get me there..thanks again!