I am a newbie and wish to learn the following;
I wish to query MySQL with PHP (my PDO connection is $dbo);
I have a the variables;
- $form_category //an integer
- $form_subcategory //an integer
- $form_subcategory2 //text
- $fname //the file name
- $form_class // 'create' is the class in this example
- $form_location //directory where the pdf is stored
My attempt at the query is;
///start query ///
$quer2 = $dbo->prepare("SELECT form_id,form_description
FROM form_detail
WHERE form_name < :form_name AND form_category = :form_category AND form_subcategory = :form_subcategory AND form_subcategory2 = :form_subcategory2");
$quer2 ->bindParam(':form_id', $form_id);
$quer2 ->bindParam(':form_name', $fname);
$quer2 ->bindParam(':form_category', $catid);
$quer2 ->bindParam(':form_subcategory', $subcatid);
$quer2 ->bindParam(':form_subcategory2', $subcat2);
$quer2 ->bindParam(':form_class', $form_class);
$quer2 ->bindParam(':form_cerfa', $form_cerfa);
$quer2 ->bindParam(':form_description', $form_description);
$quer2 ->execute();
///End new query ///
I wish to output the 'form_reference' and 'form_description' from the variables above as well as the form name($fname) and display it in a table with href on the filename for example;
echo "<td colspan=\"3\" rowspan=\"1\" style=\"text-align: center; vertical-align: middle;\"><a href=".$dir."create/".$fname." target=\"_blank\">".$fname."</a></td></tr>";