 ociparse() expects parameter 2 to be string
<p>I am getting this error : </p>

<pre><code>Warning: ociparse() expects parameter 2 to be string, resource given in /home/sjrem/public_html/SIT104_3/order.php on line 29
An error occurred in parsing the sql string. 
</code></pre>

<p>line 29: <code>$stmt = OCIParse($connect, $query);</code></p>

<p>This is my entire code : </p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;body&gt;



&lt;?php

/* Set oracle user login and password info */
$dbuser = "sjrem"; /* your deakin login */
$dbpass = "password"; /* your oracle access password */
$db = "SSID";
$connect = OCILogon($dbuser, $dbpass, $db);

if (!$connect) {
echo "An error occurred connecting to the database";
exit;
}

$sql = "SELECT * FROM purchase";
$query = OCIParse($connect, $sql);
OCIExecute($query);

/* check the sql statement for errors and if errors report them */
$stmt = OCIParse($connect, $query);
//echo "SQL: $query&lt;br&gt;";
if(!$stmt) {
echo "An error occurred in parsing the sql string.\n";
exit;
}
OCIExecute($stmt);?&gt;


&lt;table&gt;
&lt;?PHP while (OCIFetch($query)) {

   $fg1 = OCIResult ($query , "ID" ) ;   echo("&lt;tr&gt;&lt;td&gt;id: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg2 = OCIResult ($query , "FNAME" ) ;   echo("&lt;tr&gt;&lt;td&gt;name&lt;/td&gt;&lt;td&gt;");  echo ($fg2);    echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg3 = OCIResult ($query , "LNAME" ) ;   echo("&lt;tr&gt;&lt;td&gt;email: &lt;/td&gt;&lt;td&gt;");    echo ($fg3);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg4 = OCIResult ($query , "VIN" ) ;   echo("&lt;tr&gt;&lt;td&gt;Vin: &lt;/td&gt;&lt;td&gt;");    echo ($fg4);    echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg5 = OCIResult ($query , "EMAIL" ) ;   echo("&lt;tr&gt;&lt;td&gt;Email: &lt;/td&gt;&lt;td&gt;");   echo ($fg5);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg6 = OCIResult ($query , "UNIT" ) ;   echo("&lt;tr&gt;&lt;td&gt;Unit: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg7 = OCIResult ($query , "STREET" ) ;   echo("&lt;tr&gt;&lt;td&gt;Street: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg8 = OCIResult ($query , "SUBURB" ) ;   echo("&lt;tr&gt;&lt;td&gt;Suburb: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg9 = OCIResult ($query , "PCODE" ) ;   echo("&lt;tr&gt;&lt;td&gt;Post Code: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg10 = OCIResult ($query , "CREDIT" ) ;   echo("&lt;tr&gt;&lt;td&gt;Credit: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg11 = OCIResult ($query , "HOLDER" ) ;   echo("&lt;tr&gt;&lt;td&gt;Holder: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");
   $fg12 = OCIResult ($query , "EXPIRY" ) ;   echo("&lt;tr&gt;&lt;td&gt;Expiry: &lt;/td&gt;&lt;td&gt;");  echo ($fg1);   echo ("&lt;/td&gt; &lt;/tr&gt;");


}





   ?&gt;
&lt;/table&gt;


&lt;/body&gt;


&lt;/html&gt;
</code></pre>
