HostOrca Posted January 25, 2008 Share Posted January 25, 2008 I'm trying to list items from a database query. I have this code for the query if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_netsman = 10; $pageNum_netsman = 0; if (isset($_GET['pageNum_netsman'])) { $pageNum_netsman = $_GET['pageNum_netsman']; } $startRow_netsman = $pageNum_netsman * $maxRows_netsman; mysql_select_db($database_carptrader, $carptrader); $query_netsman = "SELECT companyname, email FROM tblnetsman WHERE status = '1' ORDER BY companyname ASC"; $query_limit_netsman = sprintf("%s LIMIT %d, %d", $query_netsman, $startRow_netsman, $maxRows_netsman); $netsman = mysql_query($query_limit_netsman, $carptrader) or die(mysql_error()); $row_netsman = mysql_fetch_assoc($netsman); if (isset($_GET['totalRows_netsman'])) { $totalRows_netsman = $_GET['totalRows_netsman']; } else { $all_netsman = mysql_query($query_netsman); $totalRows_netsman = mysql_num_rows($all_netsman); } $totalPages_netsman = ceil($totalRows_netsman/$maxRows_netsman)-1; and this for the repeat region <?php do { ?> <td></td> <td></td> <td width="30"><div align="center">View</div></td> <td width="30"><div align="center">Edit</div></td> <td width="30"><div align="center">Delete</div></td> <?php } while ($row_netsman = mysql_fetch_assoc($netsman)); ?> In the 2 empty td tags I want to insert the company and email fields from the database, what do i put there. Can not for the life of me get my brain to work on this, even though i have done this before Your assistance would be much apreciated 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.