Schlo_50 Posted February 7, 2007 Share Posted February 7, 2007 Anyone see anything wrong with this? It used to work and since i copied and pasted it to my new layout it doesn't want to work at all. ??? <?php $conn= mysql_connect("host" ,"dombar0_work" ,"password" ) ; if(!$conn) { echo "Unable to connect to DB: " . mysql_error(); exit; } if (!mysql_select_db("dombar0_work")) { echo " Unable to select gallery Database: " . mysql_error() ; exit; } $sql = "SELECT * FROM stock_tbl"; $result = mysql_query( $sql); if ( mysql_num_rows($result) == 0) { echo "No Documents Available at this time"; } else { $num_results = mysql_num_rows($result) ; echo "There are currently", $num_results, " images available<br>"; while ( $row = mysql_fetch_assoc( $result)) { echo $row["st_id"], " - <img src=", $row["image"], " /><br>", $row["descr"], " - ", $row["price"] ,"<br>"; ?> <?php echo "<br>"; } } mysql_free_result($result); ?> Link to comment https://forums.phpfreaks.com/topic/37432-anything-wrong/ Share on other sites More sharing options...
paul2463 Posted February 7, 2007 Share Posted February 7, 2007 what doesnt work about it??? Link to comment https://forums.phpfreaks.com/topic/37432-anything-wrong/#findComment-179003 Share on other sites More sharing options...
JasonLewis Posted February 7, 2007 Share Posted February 7, 2007 this here may be the cause of your problem, whatever that problem may be as you havnt stated it. even if it isnt, change this echo: echo $row["st_id"], " - <img src=", $row["image"], " /> ", $row["descr"], " - ", $row["price"] ," "; very very messy. change it to something like this: echo $row['st_id']." - <img src='.$row['image']."' />".$row['descr']." - ".$row['price']; your code is very very messy to begin with... Link to comment https://forums.phpfreaks.com/topic/37432-anything-wrong/#findComment-179011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.