Jump to content

AlexGrim

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://LinuxIntro.com

Profile Information

  • Gender
    Not Telling

AlexGrim's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, i keep seeing people say that using output buffering is a lazy man's fix, so i started experimenting with ways to modify my framework to NOT use it. The funny thing is that i took out the ob_start (or whatever it is), and i'm not getting any errors when logging in, redirecting, etc. Is this because i have a cache in my php.ini? output_buffering = 4096 Again, that is just in my php.ini, and there is NO ob_start in ANY of this new framework (i just copied the old, and am modifying it, but i already took out the buffering). Nope, that's not it. I changed it to 0 and i'm still not getting any errors. I'm waiting for the "You already started sending output, you can't send a header now" kind of message. Yes, i remembered to restart apache after modifying php.ini. Thanks.
  2. I'm using mysqli_query, which defaults to using mysqli_store_result, and i'm running multiple SPs on every page, but yet for this ONE command, anything after it is throwing this error. I should not be getting this error, because i'm fine everywhere else, and my code is good, so i think that it has something to do with the command itself........... Anyone else ever had this problem, when they should NOT have had this problem? If i put the next query BEFORE this statement, then it's fine, but any query after get's this error. The statement itself is fine also, and executes as expected. Thanx UPDATE: I'm an idiot. Sorry and thanx. I always TRY to return SOMETHING from a procedure, to ensure that an error did not occur. So for example, if i did an insert statement, i would select true; when finished, so that my custom sql class knows that there was no critical error. Well, for this select procedure, my dumbass wasn't paying attention and selected true after selecting a result set, causing 2 of them to be returned. I knew there was nothing wrong with my code Thanx guys, i hope this teaches someone else a lesson!
  3. The problem is that i don't know how to access elements that have namespace prefixes. If you see the last element in this node, it uses a namespace "gd", and i'm used to accessing the elment name, but the namespace is throwing it off... Here's the XML: <?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005'> .................. <entry> <id>http://www.google.com/m8/feeds/contacts/XXXXXXXXXXXXXXXX/base/0</id> <updated>2008-10-21T20:26:36.075Z</updated> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/> <title type='text'>Some Guy</title> <link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' type='image/*' href='http://www.google.com/m8/feeds/photos/media/XXXXXXXXXXXXXXXX/0/XXXXXXXXXXXXXXXX'/> <link rel='self' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/XXXXXXXXXXXXXXXX/full/0'/> <link rel='edit' type='application/atom+xml' href='http://www.google.com/m8/feeds/contacts/XXXXXXXXXXXXXXXX/full/0/XXXXXXXXXXXXXXXX'/> <gd:email rel='http://schemas.google.com/g/2005#other' address='XXXXXXXXXXXXXXXX@gmail.com' primary='true'/> </entry> </feed> and here's the php: $xml = simplexml_load_string($xml); $a[] = array(); $n=0; foreach ($xml->entry as $entry) { $a[$n][0] = $entry->email['address']; $a[$n][1] = $entry->title; $n++; } Thanx
  4. Hey, guys, i was writing a series of articles here ( http://linuxintro.com/?a=WCMS_L3&id=0107255001245562334 ) at Linux Intro, using a publishing platform that i developed myself using PHP and MySQL (among other technologies), and i noticed that when entering the command line text for those particular articles, the back slashes (which are necessary to continue a command in the Linux Command Line) keep disappearing, unless i escape them with another backslash. I have never come across this before, so was wondering if anyone knew if this was a PHP trait, or a MySQL trait. Thanx
  5. If you're talking about setting the default option in the html select list, then this is how to do that: <option value="MyValues" checked>Option Text</option> But i have the feeling that you're asking about something else, which i am totally missing...
  6. Fixed. In the bug class, i changed function __construct to function Report and in the script i changed $b=new Bug("test bug"); to $b=new Bug(); $b->Report("test bug"); and all is well. It seems that for some reason, when you try to call a parent method before the constructor is finished, then you must also call the parent class's construct as well. So by not using the parent class's methods in your construct (which in my case was not even necessary to begin with, and i just did that for the sake of brevity), you do not have to call the parent class's construct at all. Thanx guys.
  7. __construct(MySQL $handle,$desc) Do you have a pointer to any documentation where i can find this? I have not seen that type of casting before, or whatever that is called, and i would like to research it. Also, all of my functions return *something*, whether it be a boolean or an array. I think that it may have something to do with using the construct of the bug class to do something. Here in a few minutes i am going to try putting the bug report into a separate function in the bug class, and see what happens... Thanx
  8. <?php class MySQL extends MySQLi{ function __construct(){ $h="my server"; $u="my user"; $p="my pwd"; $d="my db"; parent::__construct($this->h,$this->u,$this->p,$this->d); } function Q($query){ //this prepares the query, and the other functions in this class will retrieve the data and do the proper preparations to be used as variables.... } //more functions... } class Account extends MySQL{ function CheckUser($a,$b,$c){ $r = parent::Q("call SP_Authenticate('{$a}','{$b}','{$c}')"); if ($r === true){ return true; }else{ return false; } } //more functions... } class Bug extends MySQL{ function __construct($desc){ //code to gather data about the bug... parent::Q("call SP_BugReport('{$desc}','{$etc}','{$etc}')"); } // NO more functions in this class... } ?> <?php //page script... $a = new Account(); if ($a->CheckUser($a,$b,$c) !== true){ //send them to the login page... } $i = new Image(); if ($i->DoSomethingWithThisImage() !== true){ $b = new Bug("Could not DoSomethingWithThisImage !"); //This is where i get the error //"Warning, MySQLi.Query(): Could not fetch Bug, in MySQL, on line 222". //But i do not call my Bug class from my MySQL class, //it is called the other way around. //Otherwise, if there really is an error in my MySQL class, //then it would call the bug, which uses mysql, so it gets caught in a deadlock. } ?>
  9. Does anyone know of a reason that two different classes that extend the same parent class, and call the same method, behave differently when called from the same script? For example, i have a script, and you do something, and the script says "if this works, then call $class_a and $do_this(), else call $class_b and $do_this()", and both classes inherit from $class_c. But when you $do_this() with $class_b, it will say that $class_c could not fetch $class_b. I have an autoload function to load my classes, and all classes are called from the same level/scope, so i'm kinda stumped. If i call parent::__construct() in $class_b just before i call $do_this(), everything is fine... but if i do not, it will say that $class_c could not find $class_b, but $class_b is the one who is extending $class_c, so that doesn't make any sense either... Thanx.
  10. Hey guys, i've got something that has been bugging me to death for almost 1 year now. Error reporting! I own quite a few websites, and i work on them locally and test them until they are sound enough to put on my live servers for use. The problem is, that after i will upload a large project, i get brazillian freakin error notices (undefined index, etc) that are embarrassing. I ALWAYS use error_reporting(E_ALL) and have even tried it with E_STRICT and yet i NEVER GET ANY FREAKING ERRORS! I am running Apache, on Fedora, with PHP 5.* and MySql 5.*. I don't know why i cannot see my errors locally, but i can always see them on Godaddy's servers, when i'm using the exact same error setting, but if someone could point me in the right direction on this, i'd be grateful. This makes the development process take me longer, because i cannot see errors, and so, if something doesn't work, i have to step through myself to find what the problem was, instead of php telling where it is. I have looked around to see if there is something that may need changing to get errors, but i came up with nothing. Thanx all.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.