mysql - PHP: Can't Get Oracle Table to Display on Page -


this obvious error. anyway, details:

i have oracle database need extract data populate table on php page. table called flowers , has name, price , stock columns.

the part of php code i'm having trouble this:

$titlevalue = trim($_request['search']); $query = "select * flowers name = '$titlevalue'";  $stmt = ociparse($connect, $query);  if(!$stmt) {     echo "an error occurred in parsing sql string.\n";      exit;  } ociexecute($stmt); 

the rest of php works -perfectly- when using different table on database, did test. in case, code prints query results (it's part of html table, can ignore that):

while(ocifetch($stmt)) {     echo "<tr valign=top bgcolor=#f7d4a3>";     $fg1 = ociresult($stmt,"name");     echo "<td width=75>";     echo $fg1;     echo "</td>"; // display values in column two.     $fg2 = ociresult($stmt,"price");     echo "<td width=75>";     echo ($fg2);     echo "</td>"; // display values in column 3     $fg3 = ociresult($stmt, "stock");     echo "<td width=75>";     include($fg3);     echo "</td>";     echo "</tr>"; }  

no matter $titlevalue becomes, can't results table. have tested generic $query = "select * flowers";, didn't produce either.

could please lend hand? :( it's been long night.

if may, 2 things note:

1) you're using '$titlevalue', think translate ... $titlevalue in query, , not value

2) late ... have checked table called flowers (case sensitivity)

i'd comment, dont have rep so.

if helpful, please +1 or click tickmark. try , use full format when doing sql queries

select * `table name` 'x'  

... etc. possible


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -