If this is an inappropiate request please let me know. Have searched forums and googled for tutorials, but not a php coder and don't really have time to learn it all so asking the experts. Need some simple code to accomplish the following:
Have mysql dbase (islandsbikesandb2) with one table (catalog).
6 fields in row:
id_num ( int, primary, auto increment)
mfg (varchar)
model (varchar)
type (varchar)
desc (varchar)
photo_path (varchar)
dbase and table created, Have php script to upload data via form for local admin . All works.
Need script to display contents of table(catalog) as follows:
Call: show_catalog.php? type=sometype mfg=somemfg
Return:
<html>
<body>
<table>
<tr>
<td>
for each record where type=sometype and mfg=somemfg , echo from (table=catalog)
(mfg) <br>
<img src=(photo_path) width=150px height=100> <br>
(model)
</td>
</tr>
</table>
Display: Table = 4 cells wide 4 rows high per page.As many pages as required to include all records in call.
Truncate if less than 16 matching records
No choice as to items per page for user.
A nice extra to avoid me having to shame myself by asking again:
In <td> above a link such as ><a href = show_item.php?><img src=(photo_path) width=150px height=100></a>
(eg; <a href=show_item.php? (variables to show record fields mfg, photo_path,desc for specific record))
Addition info:
Am using "includes" config.php and opendb.php in working scripts
configdb:
<?php
$dbhost = 'host_ip_address';
$dbuser = user_name';
$dbpass = 'pswd';
$dbname = 'db_name';
?>
opendb.php:
<?php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
?>
As you can see, I know just enough PHP to be dangerous..... TIA for your help, and a few pointers to some GOOD tutorials or code snippets would be much appreciated.
CaptDavid
Savannah GA
USA