Welcome Guest, Not a member yet? Register   Sign In
Question about The Video Tutorials.
#20

[eluser]jedd[/eluser]
[quote author="aussie1855" date="1258860767"]

First: As you can see I have now started using the
Code:
tags - let me know if I have used them incorrectly.
[/quote]

Smile You'll notice that whenever we talk about them, we put a space after the [ - such as [ code ] tags. Otherwise it drops you into the code format no matter what you wanted it to do.


Quote:
Code:
$q = $this->db->querry("SELECT * FROM ashbyrut_users");

query has one less r than you might think.

As to debugging .. I've been pondering writing up a blurb in the wiki, but I've only had a modicum of success getting people to rabbit on about their approaches to things. There's nothing hugely special about the way CI handles the debugging process - above and beyond your standard PHP approaches that is.

I picked this code snippet up from here - slightly modified - and it lives in my standard helper file that gets used in every project. It means I can call - from anywhere - something like:
Code:
dump ($foo_variable_I_am_wondering_about);

The code looks like this:
Code:
// ------------------------------------------------------------------------
/**
* Super Dump!
*
* Takes one parameter, and var_dumps that sucker (well, it print_r's
* it at the moment as it produces a tighter output).
*
* @param anything The variable to var_dump() straight to screen.
**/
function  dump ($var)  {
    // echo "<pre>".__FILE__.' @ line: '.__LINE__ .'<br />Result: ';
    echo "<pre>";
    if (isset ($var))
        if ($var)
            print_r ($var);
        else
            echo "dump() value FALSE or NULL";
    else
        echo "dump() value not set.";
    echo "</pre>";
    } // end-function  dump ()

Uncomment the first line if you find it useful - I normally do not.

Also I've found occasions where print_r() was more useful than var_dump(), and also vice versa, so I'll often flit into the helper function and toggle it to the other. There's probably a neater way of dealing with the respective shortcomings of print_r / var_dump.

I'd suggest that you also investigate FireBug - an astonishingly useful tool, and I know that I barely scratch the surface of its functionality.


Messages In This Thread
Question about The Video Tutorials. - by El Forum - 11-15-2009, 07:12 PM
Question about The Video Tutorials. - by El Forum - 11-16-2009, 05:26 PM
Question about The Video Tutorials. - by El Forum - 11-16-2009, 05:51 PM
Question about The Video Tutorials. - by El Forum - 11-16-2009, 05:55 PM
Question about The Video Tutorials. - by El Forum - 11-16-2009, 05:57 PM
Question about The Video Tutorials. - by El Forum - 11-17-2009, 07:09 PM
Question about The Video Tutorials. - by El Forum - 11-17-2009, 07:12 PM
Question about The Video Tutorials. - by El Forum - 11-17-2009, 07:16 PM
Question about The Video Tutorials. - by El Forum - 11-17-2009, 07:17 PM
Question about The Video Tutorials. - by El Forum - 11-17-2009, 07:27 PM
Question about The Video Tutorials. - by El Forum - 11-19-2009, 09:50 AM
Question about The Video Tutorials. - by El Forum - 11-19-2009, 09:58 AM
Question about The Video Tutorials. - by El Forum - 11-19-2009, 10:00 AM
Question about The Video Tutorials. - by El Forum - 11-20-2009, 03:36 AM
Question about The Video Tutorials. - by El Forum - 11-20-2009, 09:41 AM
Question about The Video Tutorials. - by El Forum - 11-20-2009, 09:02 PM
Question about The Video Tutorials. - by El Forum - 11-20-2009, 09:17 PM
Question about The Video Tutorials. - by El Forum - 11-21-2009, 05:57 AM
Question about The Video Tutorials. - by El Forum - 11-21-2009, 03:32 PM
Question about The Video Tutorials. - by El Forum - 11-21-2009, 03:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB