![]() |
One more thing and then I surely will. This sort script worked fine on my old site... Now it's telling me Fatal error: Call to a member function fetchObject() on a non-object in /home/taleofdr/public_html/sort.php on line 51
Code:
<?php |
Well replace every {$prefix} by ".constant('PREFIX')." and it should work for you. The reason why we are using PHP constants is that we do not need to define superglobals for database information used in functions and classes. You do not see $GLOBALS['prefix'] anymore from functions in Mys v1.3.1. Once the User class is available we will get rid of more superglobals, although some superglobals will always remain, such as $GLOBALS['adopts'] since you cannot define a constant object.
|
See, I must be tired. I tried that before I posted and I must have missed one b.c it still wasn't working. Thank you for all your help tonight HoF :) My members will thank you!
|
Still the same error? Post your script file after you've modified the SQL query using constants, I will see if something else is wrong.
|
No it's working now :) The only issue I'm having now is I don't think that the sort id's are updating into the db
Code:
<?php |
Of course its not updating the database when you still use $prefix in your sql query. XD
|
I changed it to
Code:
$adopts->query('REPLACE INTO ' . ".constant('PREFIX')." . 'sort_adoptables (`user_id`, `adoptable_id`, `sorting_id`) |
Well the cookie definition has changed, use $_COOKIE['mysuid'] instead of $_COOKIE['auid']. Honestly the code you posted above should not even work in Mys v1.3.0 security release. I strongly recommend you not to use cookie superglobals to convey information, since I may end up encrypting cookies in future to improve security(so if a hacker steals your cookie, he still gets nothing out of it but a string that makes no sense). When this happens, you will not get anything out of it. Theres no way to decrypt by writing a PHP script.
|
lol, Still not working :catfish:
|
Well try to debug by echoing the $COOKIE['mysuid'] to the screen, see what it stores. Theres a chance I already encrypted uid in cookies, and if this happens you cannot hope to use cookies as information. Like I said before, its bad practice to use cookies to fetch information such as user id, username and password unless its used internally by the script to compare hashes.
|
All times are GMT -5. The time now is 10:23 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.