1
shortman
Re: SQL insert error
  • 2006/1/5 20:29

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


queryF does work, so I guess I'll use that. Thanks for all you help. I'll post the module in about a month when I'm done.



2
shortman
Re: SQL insert error
  • 2006/1/5 20:22

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


Quote:

wtravel wrote:
Did you try using queryF instead of query? You can see if that works or not.

A second thing to check out would be the field types and (if any) the length of the fields in the table structure. Could you check both fields?


session is tinytest
prodid is int(4)

I'll try queryF, though I thought I read in one of the FAQs, that it was more advisable to use query



3
shortman
Re: SQL insert error
  • 2006/1/5 19:34

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


if only it were that simply...

I added in the second variable, but still no joy...


Script:

function newprod($cartid, $prodid){
global $xoopsDB;
print "\$prodid: " . $prodid . "<br>\$cartid: " . $cartid . "<br>";
$sql = "insert into " . $xoopsDB->prefix('xshop_cart') . " (session, prodid) VALUES ('" . $cartid. "', '" . $prodid . "')";
echo "SQL insert statement: " . $sql . "<br>";
$result = $xoopsDB->query($sql) or die('SQL Error: ' . mysql_error());
main($cartid);
}




Output:

$prodid: 1
$cartid: 09d73396846d66242b793df10a7d9ea8
SQL insert statement: insert into xoops_xshop_cart (session, prodid) VALUES ('09d73396846d66242b793df10a7d9ea8', '1')
SQL Error:



4
shortman
Re: SQL insert error
  • 2006/1/5 19:01

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


I added echo statements to make sure that the valuse in the variables are being passed, and also to check the SQL statement, and this is the result:

$prodid: 1
$cartid: 09d73396846d66242b793df10a7d9ea8
SQL insert statement: insert into xoops_xshop_cart (session) VALUES ('09d73396846d66242b793df10a7d9ea8', '1')
SQL Error:

Here is the modified function that produced the above result:

function newprod($cartid, $prodid){
global $xoopsDB;
print "\$prodid: " . $prodid . "<br>\$cartid: " . $cartid . "<br>";
$sql = "insert into " . $xoopsDB->prefix('xshop_cart') . " (sessionid) VALUES ('" . $cartid. "', '" . $prodid . "')";
echo "SQL insert statement: " . $sql . "<br>";
$result = $xoopsDB->query($sql) or die('SQL Error: ' . mysql_error());
main($cartid);
}



5
shortman
Re: SQL insert error
  • 2006/1/5 18:07

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


Opps - forgot to add the closing bracket when I posted this topic, but it is included in my php script.



6
shortman
SQL insert error
  • 2006/1/5 17:24

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


Hello everybody!

I need your assistance. I am developing a shopping cart module, and I am runnin into a perculiar problem.

Whenever a user tries to add a product to their cart, the insert statment fails, but does not give any indication of what the problem is.

The function that gets called to perform the insert is as follows:

function newprod($cartid, $prodid){
global $xoopsDB;
$sql = "insert into " . $xoopsDB->prefix('cart') . " (session, prodid) values ('" . $cartid . "', '" . $prodid . "'";
$result = $xoopsDB->query($sql) or die('SQL Error: ' . mysql_error());
}


I know the insert statement works, becuase I have something similar in the admin control panel to add categories and products.

Any help will be greatly appreciated!

TIA



7
shortman
Re: XCGallery server error when I upload the picture.
  • 2005/1/10 17:09

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


Hello:

I'm running XOOPS 2.0.9.2, and I too am having issues uploading images, either individually or in batches. When I click on the broken image icon, I get the error message:

"Unable to create thumbnail or reduced size image.GIF89a". Followed by a strings on garbage character.

I tried both Image Magick, and NetPBM. However GD 2.x work fine.



8
shortman
Error after upgrading to 2.0.6
  • 2004/4/2 21:41

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


I just upgraded from 2.0.5.2 to 2.0.6, and I have been receiving the following message at the top of each page:

"(called from 'exit') * * @access public * @return void */ function XoopsErrorHandler_Shutdown() { $error_handler =& XoopsErrorHandler::getInstance(); echo $error_handler->renderErrors(); } ?> } ?> ?> "); ?> "

Does anyone know what this means and how to fix it.

TIA!



9
shortman
Possible bug...
  • 2003/10/30 16:35

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


When ever I go into the edit groups page of the admin module, I get the following text, displayed below the groups selection box:

oopsform/grouppermform.php"; ?>

I have also seen this text appear in a couple other places..

Any ideas. I have just upgraded to 2.0.5.

TIA



10
shortman
Xoopsgallery error?
  • 2003/10/30 16:31

  • shortman

  • Just popping in

  • Posts: 10

  • Since: 2003/10/30


Hi:

I just installed upgraded to xoopsgallery 1.3.3.2 on XOOPS 2.05. The install run fine,howevere, whenever I browse my gallery, I get the follwing text at the top of the page:

($absIndex, 0); } else if ($newIndex == sizeof($visible)) { // Move to end $this->moveAlbumAbsolute($absIndex, sizeof($this->albumList)-1); } else { // Move to relative spot $this->moveAlbumAbsolute($absIndex, $absNewIndex); } return; } function moveAlbumAbsolute($index, $newIndex) { /* Pull album out */ $name = array_splice($this->albumOrder, $index, 1); /* Add it back in */ array_splice($this->albumOrder, $newIndex, 0, $name); } function getVisibleAlbums($user) { global $gallery; $list = array(); foreach ($this->albumList as $album) { if ($user->canReadAlbum($album) && $album->isRoot()) { array_push($list, $album); } } return $list; } function save() { global $gallery; $success = 0; $dir = $gallery->app->albumDir; return safe_serialize($this->albumOrder, "$dir/albumdb.dat"); } } ?> seudo() { return true; } } ?>


Also, Album names have "$i++; " appended after them.

ANy help you give will be appreciated, you can see my installation athttp://www.jabjabposse.com/modules/xoopsgallery/

H.




TopTop



Login

Who's Online

226 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 226


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