I have created a database of stockists which appears in a stockists.php page with a link from each stockist to a detailed stockist information page. I need to know the php script for a url to direct from the stockist variable {qStockists.NAME} to the detail page. In ColdFusion it is "stockistsDetail.cfm?ID=#ID#" where ID is the primary key in the database, but I can't figure out the PHP equivalent. Any help greatly appreciated. AL
If you use mysql_fetch_row(), it would be something like $row[0] or $row["ID"]. If you use mysql_fetch_array(), it may be $row[ID].
Check PHP MySQL implementation at [man]mysql[/man].
So would it be something like <a href="StockistsDetail.php?ID=$row_qStockists['ID']"> or am I missing something in the syntax? Thanks Andrew
Originally posted by ALincoln So would it be something like <a href="StockistsDetail.php?ID=$row_qStockists['ID']"> or am I missing something in the syntax? Thanks Andrew
Yes, the php start and end tags, as you need to programmatically output the variables. Try
<a href="StockistsDetail.php?ID=<?php echo $row_qStockists['ID']; ?>">