Problem with php and SQL

Reply

Join Date: Oct 2006
Posts: 7
Reputation: arunkumarsrec is an unknown quantity at this point 
Solved Threads: 0
arunkumarsrec arunkumarsrec is offline Offline
Newbie Poster

Problem with php and SQL

 
0
  #1
Dec 27th, 2006
I have recently started free domain name service <snip>. I used turnkey redirection script. My script uses php with SQL 4 . My hosting Uses sql 5. I face problem while installing. Can anybody give a solution
Last edited by stymiee; Dec 27th, 2006 at 12:18 pm. Reason: link removed
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 138
Reputation: php_daemon is an unknown quantity at this point 
Solved Threads: 2
php_daemon php_daemon is offline Offline
Junior Poster

Re: Problem with php and SQL

 
0
  #2
Dec 27th, 2006
What exactly is the problem? Any errors?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 2
Reputation: k2000 is an unknown quantity at this point 
Solved Threads: 0
k2000 k2000 is offline Offline
Newbie Poster

Problem with php and SQL

 
0
  #3
May 27th, 2008
Hi ,
i am trying to retrieve a row of data from a SQL table,but i dont get the results,i just get the variable($stock_code) that i use to search for the row on the screen.

<?php
include "dbaccess.php";
$stock_code=$_POST["txtStock"];

// Insert the required SQL query here.
$query = "SELECT STOCK_CODE FROM STOCKS WHERE STOCK_CODE = '$stock_code'";


$result = submitSQL($query, "read", 0, 0);

for ($i = 0; $i < count($result['STOCK_CODE']); $i++) {
// The for loop is used to display one result per row.
// Preferably use a key field for the count.
// Note: The fieldname must be UPPERCASE

// The next two lines are optional and are used only to help document the table structure
// in the resulting HTML code.
$row_number = $i + 1;


// For each row of SQL output, create a row in an HTML table and then
// add a data element for each field as required.
// Notes: 1. The \n additions are only to clean up the appearance of the HTML code
// but do not affect operation hence they are also optional.
// 2. The lines that contain $result need to have the appropriate field names
// in them in UPPERCASE.

echo "<tr>\n";
echo "<td>";
echo $result['STOCK_CODE'][$i];
echo "</td>\n<td>";
echo $result['STOCK_NAME'][$i];
echo "</td>\n<td>";
echo $result['PRICE'][$i];
echo "</td>\n";
echo $result['QUANTITY_AVAILABLE'][$i];
echo "</td>\n";
echo "</tr>\n";

}
?>
</table>


Any suggestions???
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC