Jump to content

Recommended Posts

Hello

 

I am hoping someone can PLEASSSSSSE help me :confused:

 

I am trying to do the following php Script..

 

 

//Getting Information for firebird database from supplier/distributor

 

try {

    $dbh = new PDO($dsndb, $userdb, $passdb);

 

    $sth = ("SELECT * from order WHERE account_number = 'abc123'");

 

 

  foreach ($dbh->query($sth) as $row)

     

// If I do print $row['order_number'].' - '. $row['customer_ref'] . '<br />'; returns all data..

    {

    $row['order_number'];

$row['customer_ref'];

      }

 

} catch (PDOException $e) {

  echo 'You have the following error : ' . $e->getMessage() . "<br/>";

  die();

}

 

$on = $row['order_number'];

$ref =  $row['customer_ref'];

 

// Need to update MYSQL Database but not sure how to create loop??????

 

 

 

        mysql_connect("localhost", "user", "password") or die(mysql_error());

mysql_select_db("xoccoza_online") or die(mysql_error());

 

$sql = "UPDATE customer SET customer_ref = '$ref' WHERE order_number = '$on' and customer_ref IS NULL";

$result=mysql_query($sql) or die(mysql_error());

 

 

Any and all help will be greatly appreciated

Link to comment
https://forums.phpfreaks.com/topic/264219-firebird-query-to-update-mysql-loop/
Share on other sites

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.