Jump to content

JayBachatero

Members
  • Posts

    296
  • Joined

  • Last visited

    Never

Posts posted by JayBachatero

  1. Are you talking about the topics/messages tables?  If so two tables would be better than having 1 large table with the topics and the messages.  The topics table would be all numeric.  The messages table would have a reference column for the id_topic.  I suggest you look at other forums and get an idea on how they do it.  Some even split it into 3 tables to optimize things but 2 tables is enough.  The 3rd table would be just a reference to the id_message and the actual post itself.

    • I can never wear any less than two shirts.

    I'm the same way.  I have to wear a white t-shirt under any shirt.  Doesn't matter what type of shirt it is.  I can't wear wife beaters. Has to be t-shirts.

     

    • I think this is actually pretty common: I like to make things line up, or be separated evenly. As I'm walking, I try to place my toes/heels exactly on the cracks in the sidewalk, or I try to space my steps out so that the cracks in the sidewalk are exactly between the foot in front and the foot in back. In the case of the latter, I also use my steps to split the sidewalk into three pieces of equal length. If I'm sitting idly, I move my head and eyes so things line up - the edge of a window with the corner of a building outside, for example.

    I'm somewhat like this but that's when I'm bored and start wondering while I'm walking.  Like I pay attention to these things more than usual.  Not sure why.

     

    Sometimes when I'm thinking or wondering I start pulling my chin hair.  Just pull it and let it go repeatedly.

  2. Change

    $query = "select * from parasite WHERE id='$_GET['id']'";
    

    to

    $_GET['id'] = (int) $_GET['id'];
    $query = "select * from parasite WHERE id='$_GET[id]'";
    

     

    Change $_GET['id'] to $_GET[id]. Added the $_GET['id'] = (int) $_GET['id']; to make sure its an integer.

  3. Most likely your new host has prefixes for databases.  Check your settings an make sure its not a prefix problem.  I'm assuming that you did backup and imported your database.  Database info is not stored like regular files that you download and ftp to new server.

  4. You have a parse error in your code.  If you are going to use single quotes you must escape them inside the string.

    eg. echo 'It\'s hot outside.';  Or else you get a parse error.  Same goes when using double quotes.  Change the opening and closing quotes to double quotes.

     

    <?php
    $sql = '
    INSERT INTO `Client`( `Client_FName` , `Client_LName` , `Client_CName` , `Client_Street` , `Client_City` , `Client_State` , `Client_Country` , `Client_Zip` , `Client_PhoneCountry` , `Client_PhoneArea` , `Client_PhonePrefix` , `Client_PhoneNum` , `Client_Email` , `Client_StartDate` , `Client_BillDate` , `Client_CurrentQuota` , `Client_CurrentPricePerGig` , `Client_SalespersonID` )
    VALUES ( 'Client_FName', 'Client_LName', 'Client_CName', 'Client_Street', 'Client_City', 'St', 'USA', 'Client_Zip', '1', '213', '555', '1212', 'Client_Email', NOW( ) , '3', '5', '2.00', '1' );';
    ?>
    

     

    <?php
    $sql = "
    INSERT INTO `Client`( `Client_FName` , `Client_LName` , `Client_CName` , `Client_Street` , `Client_City` , `Client_State` , `Client_Country` , `Client_Zip` , `Client_PhoneCountry` , `Client_PhoneArea` , `Client_PhonePrefix` , `Client_PhoneNum` , `Client_Email` , `Client_StartDate` , `Client_BillDate` , `Client_CurrentQuota` , `Client_CurrentPricePerGig` , `Client_SalespersonID` )
    VALUES ( 'Client_FName', 'Client_LName', 'Client_CName', 'Client_Street', 'Client_City', 'St', 'USA', 'Client_Zip', '1', '213', '555', '1212', 'Client_Email', NOW( ) , '3', '5', '2.00', '1' );";
    ?>

  5. You don't really need this in your code.

    $name = @mysql_query('SELECT parasitename FROM parasite');
    if (!$name) {
    exit('<p>Error performing query1: ' . mysql_error() . '</p>');
    }
    $from = @mysql_query('SELECT parasitefrom FROM parasite');
    if (!$from) {
    exit('<p>Error performing query2: ' . mysql_error() . '</p>');
    }
    $genre = @mysql_query('SELECT parasitegenre FROM parasite');
    if (!$genre) {
    exit('<p>Error performing query3: ' . mysql_error() . '</p>');
    }
    $description = @mysql_query('SELECT parasitedescription FROM parasite');
    if (!$description) {
    exit('<p>Error performing query4: ' . mysql_error() . '</p>');
    }
    $techinfo = @mysql_query('SELECT parasitetechinfo FROM parasite');
    if (!$techinfo) {
    exit('<p>Error performing query5: ' . mysql_error() . '</p>');
    }
    

     

    To order alphabetically change this.

    SELECT parasitename,parasitefrom,parasitegenre,parasitedescription,parasitetechinfo FROM parasite
    

    to this.

    SELECT parasitename,parasitefrom,parasitegenre,parasitedescription,parasitetechinfo FROM parasite ORDER BY parasitename ASC

     

    EDIT:  You might want to take a look into http://us2.php.net/manual/en/function.mysql-escape-string.php for when inserting data.

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