Jump to content

jscix

Members
  • Posts

    197
  • Joined

  • Last visited

    Never

Posts posted by jscix

  1. In my experience* they are trash. :)

     

    Most of the 'in 24 hour' books I've read, tell you how to get things done but lack any detailed description of what your actually doing.

     

    Sure you might be able to copy down the code, and have a working guestbook.. but do you understand how each part works and why it works? What if you run into an error?

     

    It's always best to understand what your doing. (I haven't actually read that sams book, though.. it may be good.) :P

  2. Theres no one way to do anything, be creative. :-)

     

    That cookie file would get enormous after a while. I'd say, you could create a temporary tables and use timestamps. (time stamp of users last login, vs timestamps of posts made) etc.. might work, no?

  3. well, I had to re-write my code in a way that when an error occured, it would still 'fall-though' the script, instead of dying. or exiting.

     

    E.G:

     

    <?
    
    //first query to obtain house info from user
    if ($GetHouseInfo = mysql_query("SELECT * FROM houses WHERE UserID='{$_SESSION['Current_User']}'")) {
    
    // Fetch the row from the database
    if (($houserow = mysql_fetch_assoc($GetHouseInfo))) {
    
    $GetHouses = mysql_query("SELECT houses.*, cities.*, countries.* FROM houses, cities, countries WHERE houses.UserID ='{$_SESSION['Current_User']}' AND cities.CityID = houses.CityID AND cities.CountryID = countries.CountryID") or die(mysql_error());
    
    if (($gethouserow = mysql_fetch_assoc($GetHouses))) {
    
    $HouseTotals = mysql_num_rows($GetHouses);
    
    $GetHouseLodgers = mysql_query("SELECT * FROM userregistration , houses WHERE userregistration.HouseID = houses.HouseID") or die(mysql_error());
    
    $HouseLoderTotals = mysql_num_rows($GetHouseLodgers);
    
    } else {
    echo "house not found";
    }
    
    } else {
    echo "usr not found";
    }
    
    }
    ?>
    

  4. PHP can't refresh the page, but it can redirect back, to the same page

     

    header("Location: page.html");

     

    You can do it in javascript easily, though.

     

    oh. Also.. if your using the Header code, nothing can be outputted before-hand. It has to come before any data is sent to the browser.

  5. if you only want to show the month, do some parsing.. rip the month out of the numerical date.

     

    $newdate = substr($order_date,5,6);

     

    then a simple case statement,

     

    switch ($newdate) {

     

    case "01":

    $month = "January";

    break;

     

    }

    etc..

×
×
  • 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.