php question from a php novice

Status
Not open for further replies.

chrislingle

Banned
Jul 18, 2006
2,544
52
0
I am working on a php site, my first and have some problems.
  1. creating individual page for each item
  2. showing image from url
  3. creating link for purchase with my aff link
  4. i want to mask the link if I can to avoid any posible search engine trouble and from hijacking
here is my basic code:
<?php
//Connect to the mysql server and get back our link_identifier
$link = mysql_connect("", "", "")
or die('Could not connect: ' . mysql_error());


//Now we select which database we would like to use
mysql_select_db("") or die('could not select database');
include ('header');

//Our SQL Query
$sql_query = "Select Name, Description, Price, LinkURL, ImageURL, Category FROM example ORDER BY Category";

//Run our sql query
$result = mysql_query($sql_query)or die('query failed'. mysql_error());
echo '<table border=0 bgcolor=#E6E6E6 align=left width="50" border="0" cellpadding=4 cellspacing=0>

<tr><td align="left"<b>Category</b>
<td align="left"><b>Name</b></td>
<td align="left"<b>Description</b></td>
<td align="left"<b>Price</b></td>
<td align="left"<b>Buy</b></td>
<td align="left"<b>Image</b>
</td></tr>
';
//iterate through result
while($row = mysql_fetch_array
($result, MYSQL_ASSOC)) {
echo '<tr><td align=
"left">' . $row['Category'] .'</td><td align="left">' .
$row['Name'] , '</td><td align=
"left">' . $row['Description'] .'</td><td align=
"left">' . $row['Price'] .'</td><td align=
"left">' . $row['LinkURL'] .'</td><td align=
"left">' . $row['ImageURL'] .'</td>
</tr>
';
}
echo '</table>';



// Free resultset (optional)
mysql_free_result($result);


//Close the MySQL Link
mysql_close($link);
include ('footer');
?>

I also have a left column for categories etc.
 


Status
Not open for further replies.