WebmasterForums.NET - Webmaster Forums & Directory
 

Go Back   WebmasterForums.NET - Webmaster Forums & Directory > Design and Development > Site Programming and Coding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Site Programming and Coding Have a problem with some code on your site? Ask our other members for advice and help.

Reply
 
Thread Tools Display Modes
Old 07-25-2006, 09:10 PM   #1
Darioush
Member
 
Darioush's Avatar
 
Join Date: Jul 2006
Location: Sunny California
Posts: 53
Darioush is on a distinguished road
Default possible PHP coding error, need help please!

hi i am doing a project and have written a PHP code to access a mySQL database, however i am having problems with being able to get a html search form to query the mySQL database. here is my PHP file code:

PHP Code:
<?php 
# FileName="Connection_php_mysql.htm" 
# Type="MYSQL" 
# HTTP="true" 
$hostname_Listings "***DON'T SHOW US YOUR LOGIN INFORMATION SILLY***"
$database_Listings "***DON'T SHOW US YOUR LOGIN INFORMATION SILLY***"
$username_Listings "***DON'T SHOW US YOUR LOGIN INFORMATION SILLY***"
$password_Listings "***DON'T SHOW US YOUR LOGIN INFORMATION SILLY***"
$Listings mysql_pconnect($hostname_Listings$username_Listings$password_Listings) or trigger_error(mysql_error(),E_USER_ERROR); 
?> 
<?php 
$maxRows_Recordset1 
20
$pageNum_Recordset1 0
if (isset(
$_GET['pageNum_Recordset1'])) { 
  
$pageNum_Recordset1 $_GET['pageNum_Recordset1']; 

$startRow_Recordset1 $pageNum_Recordset1 $maxRows_Recordset1
 
mysql_select_db($database_Listings$Listings); 
$query_Recordset1 "SELECT * FROM listings "
$query_limit_Recordset1 sprintf("%s LIMIT %d, %d"$query_Recordset1$startRow_Recordset1$maxRows_Recordset1); 
$Recordset1 mysql_query($query_limit_Recordset1$Listings) or die(mysql_error()); 
$row_Recordset1 mysql_fetch_assoc($Recordset1); 
 
if (isset(
$_GET['totalRows_Recordset1'])) { 
  
$totalRows_Recordset1 $_GET['totalRows_Recordset1']; 
} else { 
  
$all_Recordset1 mysql_query($query_Recordset1); 
  
$totalRows_Recordset1 mysql_num_rows($all_Recordset1); 

$totalPages_Recordset1 ceil($totalRows_Recordset1/$maxRows_Recordset1)-1
?> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Untitled Document</title> 
</head> 
 
<body> 
<table border="1"> 
  <tr> 
    <td>Ad Number</td> 
    <td>Resort</td> 
    <td>City</td> 
    <td>State</td> 
    <td>Country</td> 
    <td>Bedrooms</td> 
    <td>Bathrooms</td> 
    <td>Week#</td> 
    <td>Lockout</td> 
    <td>Price</td> 
  </tr> 
  <?php do { ?> 
    <tr> 
      <td><?php echo $row_Recordset1['Ad Number']; ?></td> 
      <td><?php echo $row_Recordset1['Resort']; ?></td> 
      <td><?php echo $row_Recordset1['City']; ?></td> 
      <td><?php echo $row_Recordset1['State']; ?></td> 
      <td><?php echo $row_Recordset1['Country']; ?></td> 
      <td><?php echo $row_Recordset1['Bedrooms']; ?></td> 
      <td><?php echo $row_Recordset1['Bathrooms']; ?></td> 
      <td><?php echo $row_Recordset1['Week#']; ?></td> 
      <td><?php echo $row_Recordset1['Lockout']; ?></td> 
      <td><?php echo $row_Recordset1['Price']; ?></td> 
    </tr> 
    <?php } while ($row_Recordset1 mysql_fetch_assoc($Recordset1)); ?> 
</table> 
</body> 
</html> 
<?php 
mysql_free_result
($Recordset1); 
?>
if anyone out there could help me out with getting this to work, i would really appreciate it. Thanks, Henry
__________________
Napa Valley wine, wineries, on-line wine sales, lodging, vacations, golf, current events http://www.napavalley.com
Darioush is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 07:57 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
WebmasterForums.NET - Webmaster Forums & Directory