SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 46 of 46
  1. #26
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a long thread... I posted the same error today in a new thread and crmalibu pointed me to this.

    With messing around the error, and changing everything around, using different databases, different tables... it all comes down to one thing... the query wont select two columns, you can insert many columns, data, etc, but the problem lies in the selecting... which is weird, because the code works when you open up the cmd prompt and type this in there, no problem...

    I am going to have a look at another book tomorrow because I cant waste anymore time with this, but if anyone finds the solution quicker than that, please let me know... ill port something up tomorrow.

    vc08... are you saying that you can delete? and installed mysql and php5 and apache all individually? Anything to do with Windows Vista then??? Be good to narrow down the problem... I was going to try on a mac when I get my hands on one.


    Cheers

    Mark

  2. #27
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I missed out FBrill...
    QUOTE:

    I HAVE FOUND THE SOLUTION!

    Don't ask me how, or why, but i had a suspicion that in can be the PHP installation.

    So I installed PHP 5.3.0 and did the set-up according to the book (4th ed) (Accept u must use the php.ini-production file as basis for the settings) and its working 100%, so the code is solid as is!

    To download and instal go to:

    Will post url shortly - sorry the forum doesnt want me to publish links because i have les than 10 posts.

    and get the VC6 x86 Thread Safe - Zipped version.

    Hope this sorts out your problem as well!

    END QUOTE

    So if it works, ill be shouting F(****ing )Brill

  3. #28
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, is it development or production that I use? I have used production to install php and php5.3 appears in the status bar of the apache service monitor correctly. I then proceeded to test some of the pages that were working in localhost and the pages with database connections just appear in blank, however the welcome pages do work, is there something I have forgotten to do? Please help.

  4. #29
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mwatkins84 View Post
    This is a long thread... I posted the same error today in a new thread and crmalibu pointed me to this.

    With messing around the error, and changing everything around, using different databases, different tables... it all comes down to one thing... the query wont select two columns, you can insert many columns, data, etc, but the problem lies in the selecting... which is weird, because the code works when you open up the cmd prompt and type this in there, no problem...

    I am going to have a look at another book tomorrow because I cant waste anymore time with this, but if anyone finds the solution quicker than that, please let me know... ill port something up tomorrow.

    vc08... are you saying that you can delete? and installed mysql and php5 and apache all individually? Anything to do with Windows Vista then??? Be good to narrow down the problem... I was going to try on a mac when I get my hands on one.


    Cheers

    Mark
    I installed Apache, PHP and MySQL individually. I had the very same issue after installing with blank pages. Even after installing PHP 5.3.0. and with 5.3.0 appearing in the Apache Status Window.

    Before you install PHP 5.3. Remove all PHP 5.2. files from the PHP folder (Remember to stop Apache Server), then install the fresh PHP 5.3. and configure as instructed by Kevins book. This seemed to do the trick after a couple of restarts (PC not just apache!).

    I'm working on XP Pro.

  5. #30
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did this, I deleted all the old php files before installing it, and have restarted apache several times but still blank page!

  6. #31
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May sound studip but are you testing on the local host root directory or using a sub directory?

  7. #32
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well the files in the root directory work because they are just the welcome files, but when I test the subdirectories that connect to a DB, e.g.
    http://localhost/deletejoke/

    blank page.

  8. #33
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using the $_SERVER array in the 'include' line for connecting to the db. I dont have the book with me so can't remeber you start using this at the point you are at.

    Make sure you have specified the location '/deletejoke/includes/db.inc.php' as I made the mistake of leaving out the 'deletejoke' and so ofcourse the server was looking for the includes folder in the root dir not deletejoke dir.

  9. #34
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure what you mean to be honest, I'm on p148-149 and there is not mention of including an includes folder in the deletejoke directory.

  10. #35
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah sorry, you have all that to come yet. Post your code so we can see it.

  11. #36
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your help tw, it's probably something silly I have missed out: This is the index.php:

    <?php
    if (get_magic_quotes_gpc())
    {
    function stripslashes_deep($value)
    {
    $value=is_array($value) ?
    array_map('stripslashes_deep', $value):
    stripslashes($value);

    return $value;
    }
    $_POST=array_map('stripslashes_deep',$_POST);
    $_GET=array_map('stripslashes_deep',$_GET);
    $_COOKIE=array_map('stripslashes_deep',$_COOKIE);
    $_REQUEST=array_map('stripslashes_deep',$_REQUEST);
    }

    if (isset($_GET['addjoke']))
    {
    include 'form.html.php';
    exit();
    }

    $link=mysqli_connect('localhost','root','password');
    if (!$link)
    {
    $error='Unable to connect to the database server.';
    include'error.html.php';
    exit();
    }

    if (!mysqli_set_charset($link, 'utf8'))
    {
    $output='Unable to set databse connection encoding.';
    include 'output.html.php';
    exit();
    }

    if (!mysqli_select_db($link,'ijdb'))
    {
    $error='Unable to locate the joke database.';
    include 'error.html.php';
    exit();
    }

    if(isset($_POST['joketext']))
    {
    $joketext=mysqli_real_escape_string($link,$_POST['joketext']);
    $sql='INSERT INTO joke SET
    joketext="'.$joketext . '",
    jokedate=CURDATE()';
    if (!mysqli_query($link,$sql))
    {
    $error='Error adding sumitted joke:' . mysqli_error($link);
    include 'error.html.php';
    exit();
    }

    header('Location: .');
    exit();

    }

    if (isset($GET['deletejoke']))
    {
    $id=mysqli_real_escape_string($link,$_POST['id']);
    $sql="DELETE FROM joke WHERE id='$id'";
    if (!mysqli_query($link,$sql))
    {
    $error='Error deleting joke: ' . mysqli_error($link);
    include 'error.html.php';
    exit();
    }

    header('Location: .');
    exit();
    }

    $result=mysqli_query($link,'SELECT id, joketext FROM joke');
    if (!$result)
    {
    $error='Error fetching jokes; ' . mysqli_error($link);
    include 'error.html.php';
    exit();
    }

    while ($row=mysqli_fetch_array($result))
    {
    $jokes[]=array('id'=>$row['id'],'text'=>$row['joketext']);
    }

    include 'jokes.html.php';





    ?>

  12. #37
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think it has anything to do with the code to be honest, because I just copied in the code they provide into my htdocs folder and this displays a blank page too. (I obviously changed the password to access mysql)

  13. #38
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok so now I have fixed it, the extension_dir="C:\PHP\ext" did not have the semi colon removed. But my jokes still aren't deleting can anyone help please?

  14. #39
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you getting any error messages. Paste this into your code and it should start showing your errors

    ini_set('display_errors',1);

    error_reporting(E_ALL);

    This will help point you in the direction of any errors in your code.

  15. #40
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    fixed it now I had a _ missing. doh!

  16. #41
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chulo View Post
    Ok so now I have fixed it, the extension_dir="C:\PHP\ext" did not have the semi colon removed. But my jokes still aren't deleting can anyone help please?
    It doesnt say to remove the semi colon here...

    Also,

    ; Directory in which the loadable extensions (modules) reside.
    ; website [I have less than 5 posts...]
    ; extension_dir = "./"
    ; On windows:
    ; extension_dir = "ext"

    Which extension_dir do I use... there is two?

  17. #42
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lanwendy View Post
    This worked for me too. I installed PHP 5.3.0 and got everything working. Thanks so much for the help.
    Did you not get blank screens... or did it work immediately... I have installed it, copy and pasted the production file, renamed it php.ini and made the changes... although for the extension_doc there were two... I am guessing to use the second one "for windows"...

    But I have restarted my computer a few times, Apache shows that it is using PHP 5.3.0... I get the "It works" when I go to to http://localhost:8080/ but if I try a file that links to the database, I get nothing just a blank page in Mozilla... and a http 404 in I.E

    So many obstacles... what a pain in the ...

    thanks in advance

    Mark

  18. #43
    SitePoint Member
    Join Date
    Aug 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I&#180;d like to say, I have resolved it my end now, Copy and pasted the php.ini file from PHP5.2 into PHP5.3 and worked straight away.

  19. #44
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mwatkins84 View Post
    It doesnt say to remove the semi colon here...

    Also,

    ; Directory in which the loadable extensions (modules) reside.
    ; website [I have less than 5 posts...]
    ; extension_dir = "./"
    ; On windows:
    ; extension_dir = "ext"

    Which extension_dir do I use... there is two?
    If I don't delete the semicolon there it doesn't work for me.

  20. #45
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Location
    Newcastle Australia
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    I posted in mysql about phpmyadmin causing the MS error message when I try to log in.
    Finding this thread gives me hope.
    Downloading 5.3 now.
    Won't get to try it until Friday.
    Let you all know how it goes.

  21. #46
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Location
    Newcastle Australia
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed It


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •