Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how do I add account created date to invoice


mrbaddis

Recommended Posts

Posted

My goal is to print account created date under order number. I tried the following but got stuck I am not very good at PHP. I found this script on PHP web site it works but it prints all of the account created date on screen. I just want to print one on invoice for each customer just like how order number is printed once.

 

---- Script out puts -----

 

16:16:192005-04-13 17:02:082005-04-13 20:53:492005-04-13 22:32:252005-04

13:14:332005-04-14 14:37:452005-04-14 20:20:282005-04-14 20:27:192005-04

---- Keeps Going ------

 

should look like

 

Order Number: 5207

Order Date & Time: 2006-03-27 11:27:45

account created: 2005-04-13

 

--------- Script I added this to top on admin/invoice.php ------

 

// Formulate Query

// This is the best way to perform a SQL query

// For more examples, see mysql_real_escape_string()

$query = sprintf("SELECT customers_info_date_account_created FROM customers_info ",

mysql_real_escape_string($customers_info_date_account_created),

mysql_real_escape_string($option_id));

 

// Perform Query

$result = mysql_query($query);

 

// Check result

// This shows the actual query sent to MySQL, and the error. Useful for debugging.

if (!$result) {

$message = 'Invalid query: ' . mysql_error() . "\n";

$message .= 'Whole query: ' . $query;

die($message);

}

 

 

// Print out array

while ($row = mysql_fetch_assoc($result)) {

echo $row['customers_info_date_account_created'];

 

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...