My problem was that my SQL class is a wrapper around MDB2. Obviously the SQL
class didn't have a lastInsertID() method of its own (but now it does!):
public function InsertID() {
return $this->db->lastInsertID();
}
Thanks for all the help,
Yves
-- Original Me
Have a look at this:
http://wiki.pooteeweet.org/index.php?area=MDB2&page=ExampleS&view=diff&to=2006-05-25%2010:27:49&from=2006-03-22%2011:08:24
It loads the Extended module
On Mon, Sep 8, 2008 at 8:55 PM, YVES SUCAET <[EMAIL PROTECTED]> wrote:
> Interesting. I'm following the documentation at
Interesting. I'm following the documentation at
http://pear.php.net/manual/en/package.database.mdb2.intro-sequences.php
Here's my code:
$sql = new SQL();
$sql->connect(DSN_METNET3_MY_EDIT);
$qry = "insert into List(lstName, lstNotes, UserName) values ($name,
$notes, $user)
Here are some other options for escaping:
http://pear.php.net/manual/en/package.database.mdb2.intro-quote.php
I think getAfterId will not work - seems to be part of LiveUser Admin.
Interesting stuff, definitely worth a look.
On Mon, Sep 8, 2008 at 7:14 PM, YVES SUCAET <[EMAIL PROTECTED]> wrote:
> * mysql_last_insert_id()
getAfterId()
http://pear.php.net/reference/LiveUser_Admin-0.3.3/LiveUser_Admin/LiveUser_Admin_Storage_MDB2.html#methodgetAfterId
> * mysql_real_escape_string()
escape()
http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Common.html#methodescape
--
PHP Da
Hi List,
What are the equivalent MDB2 methods for:
* mysql_last_insert_id()
* mysql_real_escape_string()
Much obliged,
Yves
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
all of us do, it's subscribed to the list. i filter it out.
On Mon, Sep 8, 2008 at 7:06 PM, Chris Hale <[EMAIL PROTECTED]> wrote:
> Evert Lammerts wrote:
>>
>> My bad! Forgot the dollar signs This should work:
>> function editproduct($item_id, $item_name, $item_desc, $item_price,
>> $item_pix,
Do a print on the query:
>> function editproduct($item_id, $item_name, $item_desc, $item_price,
>> $item_pix, $item_man_id, $item_cat_id) {
>>$item_id = mysql_real_escape_string($item_id);
>>$item_name = mysql_real_escape_string($item_name);
>>$item_desc = mysql_real_escape
You need to run mysql_real_escape_string() on all of your input
variables before using them:
function editproduct($item_id, $item_name, $item_desc, $item_price,
$item_pix, $item_man_id, $item_cat_id) {
$item_id = mysql_real_escape_string($item_id);
$item_name = mysql_real_escape_st
Niel Archer wrote:
Hi
I have the following function:
function
add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix)
{
connect();
if($item_pix == "")
{
$sql = "INSERT INTO items
(item_name,item_desc,item_price,item_man_id,item_cat_id) VALU
10 matches
Mail list logo