|
 trandra - 2008-02-25 09:28:41
how to use function Query($query,$data=array()) ?
 meth - 2008-02-25 18:46:58 - In reply to message 1 from trandra
The Query function is very easy to use, ex:
$db->Query('SELECT * FROM my_table WHERE MyField = ?',array($valueOfField));
This is used to prevent SQL Injection. You can use ? in the Query to substitue it for the data passed through the array.
 trandra - 2008-02-26 06:18:11 - In reply to message 2 from meth
Can you help me because I am very hopeless in php but I want to use your Class because I see it very good.
I have this table rslangue(idLangue,Langue) and 4 data.
This is my script:
<?php
require_once ('dbsql.class.php');
$conn=new DBSQL('mysql','localhost','root','','dbomef');
$sql_stat="select * from rslangue";
$valueOfField="Francais";
$conn->Query('SELECT * FROM rslangue WHERE Langue = ?',array($valueOfField));
?>
and I have this error on navigator:
Notice: Undefined offset: 1 in G:\EasyPHP 2.0b1\www\model\dbsql.class.php on line 211
How to display all data in my table rslangue
 meth - 2008-02-27 02:38:00 - In reply to message 3 from trandra
Try with this code:
<?php
require_once ('dbsql.class.php');
$conn=new DBSQL('mysql','localhost','root','','dbomef');
$conn->Query('SELECT * FROM rslangue WHERE Langue = ?',array('Francais'));
?>
|