Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dysplaying custom fields from database


Luke99

Recommended Posts

I have a form that calculates pricing for a service we offer. The results are sent to the database, now I would like to display these results for the customer.

I'm using the statement below but it doesn't work. Anyone have any ideas?

I know it's not pretty code, i'm just bluffing my way....

 

Statement:

<?php 
           $IP = $_SERVER['REMOTE_ADDR'];
           $Link = mysql_connect("localhost", "username", "password") or 
die("Unable to connect to the server. Please try again later."); 
mysql_select_db("database",$Link);

$result = mysql_query("SELECT * FROM reviews ORDER BY reviews_id DESC LIMIT 1"); 
if (!$result) {
  echo 'Could not run query: ' . mysql_error();
  exit;
}
if ($IP = $row ['IPAddress']) {
 echo 'Please try again';
 exit;
}else{
while ($row = mysql_fetch_assoc($result)) {
  echo $row['IPAddress'];
  echo $row['WordCount'];
  echo $row['FileCount'];
  echo $row['Price'];
}
}
            ?>

I would like to display the last entry that matches the IP address of the customer.

Thanks!

SS:20030317

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...