Hello,
I'm producing a website as part of a uni project that will hold a load of recipes, and allow users to search for them. The database is hosted using Oracle and I have some basic PHP code to help me connect to it:
<?php
if ($c=ora_logon("username@orcl","password")) {
echo "Successfully connected to Oracle.n";
ora_commitoff($c);
ora_logoff($c);
} else {
echo "Oracle Connect Error " . ora_error();
}
?>
This works - and connects. But I need some guidance in how I take what is put into the search box and turn that into an SQL query, then display the results.
As I have little PHP experience - do I declare the search box as a global variable? Can I use that variable in an SQL query?
Also, after each query, do I disconnect from the database?
I'm producing a website as part of a uni project that will hold a load of recipes, and allow users to search for them. The database is hosted using Oracle and I have some basic PHP code to help me connect to it:
<?php
if ($c=ora_logon("username@orcl","password")) {
echo "Successfully connected to Oracle.n";
ora_commitoff($c);
ora_logoff($c);
} else {
echo "Oracle Connect Error " . ora_error();
}
?>
This works - and connects. But I need some guidance in how I take what is put into the search box and turn that into an SQL query, then display the results.
As I have little PHP experience - do I declare the search box as a global variable? Can I use that variable in an SQL query?
Also, after each query, do I disconnect from the database?