Hi I am still quite new to PHP, but recently I have been having some strange problems.

Everything seemed to be set up fine, and I tested scripts that worked well.

Now, somehow most of my scripts will not even display any output at all inc the html forms, even those that previously did. I fear I may have changed something on php.ini files acidentally but I cant be sure.

At the moment the problem looks like it might be something to do with Mysql as all my test scripts with SQLite are still working.

I am using PHP5, MySQL server 4.1 Apache 2.0 and running php as a module on windows xp.

Please help, my project is due in two weeks and im starting to panic.🙁

    I responded to your previous post (http://www.phpbuilder.com/board/showthread.php?s=&threadid=10296754) highlighting 4 basic errors in your code.

    Did you see if that works? Did you still get errors or no output? What happened?

    It's no good asking why things don't work and not trying out the responses.

    Even if you think it's something else than typo's etc in your code, at least confirm that fixing them still does not fix your problem!

    Paul.

      Yeah I did fix the errors and try that but there was still no output at all.
      I have even tried using simple examples from books but they dont work either.

        OK roni,

        Create a file called info.php with the following script ...

        <?php
        echo phpinfo();
        ?>

        Put in on your server (in the root will do) and navigate to it in the browser. You should get a full list PHP configurations, including a description of MySQL, if it is loading correctly.

        Try that and come back.

        Paul.

          Hey Paul

          I've done that it works fine, and there is a section with mysql details.

          Roni

            Ok, so that tells us that PHP is running OK on your server, along with MySQL.

            So, next test (replacing DB_HOST, DB_USER, DB_PASSWORD and DB_NAME with your own details)...

            $link_id = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
            if(!$link_id){
            	die('Could not connect to mysql');
            } else if(!@mysql_select_db(DB_NAME)) {
            	die('Could not select db');
            } else {
            	echo 'Success!';
            }
            

            ... and let us know the result.

            Paul.

              Originally posted by paulnaj
              ... and let us know the result.

              At this stage I'd prefer leaving the @ signs off so that I could receive any errors due to the database connection or selection failing.

                Just tried that, it returns:

                Could not select db

                which makes sense. Also I found out what the problem was with all my php scripts they all included a file that had some syntax that php didnt seem to like, so now i am getting the output as expected.
                Cheers for the help guys!!

                Now back to the first problem, Im still not able to insert data obtained from the form into mysql from php.

                I will look into all the scripts again.

                  Write a Reply...