1
phillipd
$xoopsDB->query() doesn't work for "alter table ... drop column ..."
  • 2004/12/7 7:28

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I use $xoopsDB->query() for SELECT, UPDATE, INSERT and adding columns and it works fine. But I tried to delete a column with:

$rec = "ALTER TABLE ".$xoopsDB->prefix('inventory')." DROP COLUMN ".$colname."";

$xoopsDB->query($rec);

And it doesn't work. Any ideas? queryF works ok...

I know the drop syntax is correct because I echo $rec and paste it to mysql's command line interface and it works fine.

Also, after noting the following from the mysqldatabase.php file, how do ANY queries work?

/**
* perform a query
*
* This method is empty and does nothing! It should therefore only be
* used if nothing is exactly what you want done!
*
* @param string $sql a valid MySQL query
* @param int $limit number of records to return
* @param int $start offset of first record to return
*
* @abstract
*/
function &query($sql, $limit=0, $start=0)
{

}

How is it my other queries even work??? What's up with this? What am I missing?

Regards

Doug P

2
winsion
Re: $xoopsDB->query() doesn't work for "alter table ... drop column ..."
  • 2004/12/7 9:22

  • winsion

  • Just popping in

  • Posts: 55

  • Since: 2003/11/23


test : $rec = "ALTER TABLE ".$xoopsDB->prefix('inventory')." DROP COLUMN $colname ";

3
Mithrandir
Re: $xoopsDB->query() doesn


Login

Who's Online

172 user(s) are online (108 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits