Forums
This topic is locked
adorecordset_mysql
Posted 20 May 2002 13:28:17
1
has voted
20 May 2002 13:28:17 Ken Carter posted:
New error now. When I load the page the first time everything comes up just as would be expected. Hitting the back button and reloading the page, via click, or refresh, or selection of a different item in the repeat region results in the error below. This is kind of a good news bad news sort of issue. I'm happy that I'm getting some sort of error back on this but have no clue what I'm looking at or for. Right now I'm tearing though the manual to try and find something that will help...
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition adorecordset_mysql of the object you are trying to operate on was loaded _before_ the session was started in /usr/local/psa/home/vhosts/goodnplentystore.com/httpdocs/gardenstones.php on line 44
Thanks,
Ken
PS: Will be so happy when I'm up to speed here and can help so other folks instead of asking questions.
Replies
Replied 20 May 2002 14:45:37
20 May 2002 14:45:37 Bruno Mairlot replied:
Hi Ken !
the problem you are experiencing, is that you are trying to load an object from a session variable.
But the class that defines this variable hasn't been parsed by PHP when you load it. Therefore, PHP can't know about the class method or properties you are accessing in page 44.
Try to make sure your class description (or the inclusion of your code file) is placed at the very top of your file, *before* the function session_start().
This way PHP will know about your class when you'll use your object in line 44.
Hope this helps.
Bruno
the problem you are experiencing, is that you are trying to load an object from a session variable.
But the class that defines this variable hasn't been parsed by PHP when you load it. Therefore, PHP can't know about the class method or properties you are accessing in page 44.
Try to make sure your class description (or the inclusion of your code file) is placed at the very top of your file, *before* the function session_start().
This way PHP will know about your class when you'll use your object in line 44.
Hope this helps.
Bruno
Replied 20 May 2002 15:01:37
20 May 2002 15:01:37 Ken Carter replied:
Any idea why this would work on the first pass and not on a refresh or reload?
I think the code that is stumbling is from Impakt's repeat region which calls this page. I'll try getting in touch with them too, but with the time zone issues take 24 hours to get a response so I thought I would try here.
I'll play around with what you suggest but at this point I can't be sure just exactly what their extension has plugged in that is failing. Oh what a tangled web we weave! Thanks!
Ken...
I think the code that is stumbling is from Impakt's repeat region which calls this page. I'll try getting in touch with them too, but with the time zone issues take 24 hours to get a response so I thought I would try here.
I'll play around with what you suggest but at this point I can't be sure just exactly what their extension has plugged in that is failing. Oh what a tangled web we weave! Thanks!
Ken...
Replied 20 May 2002 15:05:42
20 May 2002 15:05:42 Bruno Mairlot replied:
The reason why it succeed on the first pass and not the second, is probably because at the first pass it is not stored as a session variable.
And therefore when the object is created and used, PHP knows about the class. But when it is loaded from the session it is too late.
Could you post the 44 first line of your page, so that we can look at where exactly there is a problem ?
Bruno
And therefore when the object is created and used, PHP knows about the class. But when it is loaded from the session it is too late.
Could you post the 44 first line of your page, so that we can look at where exactly there is a problem ?
Bruno
Replied 20 May 2002 16:21:39
20 May 2002 16:21:39 Ken Carter replied:
Actually here is the first 45 lines of code. #45 terminates the php is all. Thank you so much for helping me with this.
Ken...
<?php
// IntelliCART (PHP Shopping Cart System) v1.0
// (c)2001. Tim Green. All rights reserved.
require_once("./classes/IntelliCART.inc.php"
if (!defined("IC_UDDET"){
session_start();
}
?><?php
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT" // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s" . " GMT" // always modified
header ("Cache-Control: no-cache, must-revalidate" // HTTP/1.1
header ("Pragma: no-cache" // HTTP/1.0
?><?php
// Copyright (c) Interakt Online 2001
// www.interakt.ro/
require("./adodb/adodb.inc.php"
require("./Connections/sitedb.php"
?><?php
// Initialise IntelliCART
if (!defined("IC_UDDET"){
if (!session_is_registered("stones") {
session_register("stones"
$stones = new IntelliCART("ItemID,Name,Description,Quantity,Unit_Weight,Price,ShippingPrice,ItemSubTotal,SubTotal,Total,Total_Weight"
$stones->BaseCurrency = "USD";
$stones->DisplayCurrency = "USD";
$stones->showCountryCode = true;
$stones->currencySymbol = "";
}
} else {
$stones = new IntelliCART("ItemID,Name,Description,Quantity,Unit_Weight,Price,ShippingPrice,ItemSubTotal,SubTotal,Total,Total_Weight"
$stones->BaseCurrency = "USD";
$stones->DisplayCurrency = "USD";
$stones->showCountryCode = true;
$stones->currencySymbol = "";
loadTestData($stones);
}
$stones_totalRows = $stones->count;
?>
Ken...
<?php
// IntelliCART (PHP Shopping Cart System) v1.0
// (c)2001. Tim Green. All rights reserved.
require_once("./classes/IntelliCART.inc.php"
if (!defined("IC_UDDET"){
session_start();
}
?><?php
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT" // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s" . " GMT" // always modified
header ("Cache-Control: no-cache, must-revalidate" // HTTP/1.1
header ("Pragma: no-cache" // HTTP/1.0
?><?php
// Copyright (c) Interakt Online 2001
// www.interakt.ro/
require("./adodb/adodb.inc.php"
require("./Connections/sitedb.php"
?><?php
// Initialise IntelliCART
if (!defined("IC_UDDET"){
if (!session_is_registered("stones") {
session_register("stones"
$stones = new IntelliCART("ItemID,Name,Description,Quantity,Unit_Weight,Price,ShippingPrice,ItemSubTotal,SubTotal,Total,Total_Weight"
$stones->BaseCurrency = "USD";
$stones->DisplayCurrency = "USD";
$stones->showCountryCode = true;
$stones->currencySymbol = "";
}
} else {
$stones = new IntelliCART("ItemID,Name,Description,Quantity,Unit_Weight,Price,ShippingPrice,ItemSubTotal,SubTotal,Total,Total_Weight"
$stones->BaseCurrency = "USD";
$stones->DisplayCurrency = "USD";
$stones->showCountryCode = true;
$stones->currencySymbol = "";
loadTestData($stones);
}
$stones_totalRows = $stones->count;
?>
Replied 20 May 2002 23:13:06
20 May 2002 23:13:06 Tim Green replied:
Ken,
I think I've worked out the problem here, thanks to combining your last post with this one.
It would appear that you are creating a recordset called "stones" and you've also created an IntelliCART instance called "stones".
These both define the variable $stones, sothe problems you are experiencing are because the recordset is trying to use a variable that has already been defined as a session.
Try renaming your recordset to "rsStones" (following standard recordset naming conventions) and this problem should resolve itself.
Hope this helps
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
I think I've worked out the problem here, thanks to combining your last post with this one.
It would appear that you are creating a recordset called "stones" and you've also created an IntelliCART instance called "stones".
These both define the variable $stones, sothe problems you are experiencing are because the recordset is trying to use a variable that has already been defined as a session.
Try renaming your recordset to "rsStones" (following standard recordset naming conventions) and this problem should resolve itself.
Hope this helps
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 21 May 2002 15:01:12
21 May 2002 15:01:12 Ken Carter replied:
Tim,
That did the trick!
The pages are looking really good (in my eyes). Since this flows into your cart from the form on this page. Real quick question then I will jump over to rawveg for follow ups of any further cart issues.
The page that is refered to in the add to cart from form. That is just a report that the item was added to the cart correct? I think I need to build a unique page for that to keep the naviagtion consistent and then create a checkout button for my product pages to view and let the user manage their cart contents. This is working slick! Love it!
Thanks,
Ken
That did the trick!
The pages are looking really good (in my eyes). Since this flows into your cart from the form on this page. Real quick question then I will jump over to rawveg for follow ups of any further cart issues.
The page that is refered to in the add to cart from form. That is just a report that the item was added to the cart correct? I think I need to build a unique page for that to keep the naviagtion consistent and then create a checkout button for my product pages to view and let the user manage their cart contents. This is working slick! Love it!
Thanks,
Ken