Jump to content

Can you help me


HostOrca

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated