[PHP] what am i doing wrong..??
Hi there please have a look the code below...I dont know wht am doing wrong here... This code is suppose to show the number of jokes in a mysql database and allows user to add a joke when the user clicks addjoke link. And when the joke is added, it suppose to say that "Joke inserted, Thank you" and list all the jokes below this line. So far am able to view all the jokes and take the user to add joke page. But the problem is when the user clicks insert joke button, it does not display the message "Joke inserted, Thank you" and the jokes are not listed. Infact it does not give any error aswell, it just stays on the add joke form page. I checked the database and no joke is added. Working on PHP ver 4.3.8 with register_globals turned OFF and Apache 1.3.31. MySQL ver 4.0.20a on winXP pro SP1. Recently i started using registre_globals OFF and all these probs strted coming up. This code was working fine with globals ON. But my hosting has it off. So need to do so. I was able to fix all the other issues came coz of this global thing in this code. But stuck on the issue i just mentioned. Any help would be GREATLY appreciated. Type your joke : "; echo mysql_error(); } $color1 = "#66CCFF"; $color2 = "#66CC99"; $row_count = 1; // -- Following lines list the jokes in the database echo " These are the jokes we have got so far"; $db = mysql_connect("localhost","homesite","test") or die(mysql_error()); mysql_select_db("jokes",$db); $sql = "SELECT id, JokeText, JokeDate from jokes"; $query = mysql_query($sql); echo " ID Joke Text Joke Date"; while ($myrow = mysql_fetch_array($query)) { $row_color = ($row_count % 2) ? $color1 : $color2; echo"". "". $myrow["id"]."". "". $myrow["JokeText"]. "". "". $myrow["JokeDate"].""; $row_count++; } echo ""; $current_url = $_SERVER['PHP_SELF']; echo("" ."Add a Joke!"); } // end main else statement ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] This is weird..whts the prob???
Hi guys, Working on PHP ver 4.3.8 with register_globals turned OFF and Apache 1.3.31. MySQL ver 4.0.20a on winXP pro SP1. This script does not seems to work with the method of POST. When I change it to GET method the data is entered into the database, but with POST it does not. I have another script with the POST method, but that script works with POST. What is wrong with this script. Here goes the script. What am I doing wrong. Type your joke : "; echo mysql_error(); } $color1 = "#66CCFF"; $color2 = "#66CC99"; $row_count = 1; // -- Following lines list the jokes in the database echo " These are the jokes we have got so far"; $db = mysql_connect("localhost","homesite","ju4754") or die(mysql_error()); mysql_select_db("jokes",$db); $sql = "SELECT id, JokeText, JokeDate from jokes"; $query = mysql_query($sql); echo " ID Joke Text Joke Date"; while ($myrow = mysql_fetch_array($query)) { $row_color = ($row_count % 2) ? $color1 : $color2; echo"". "". $myrow["id"]."". "". $myrow["JokeText"]. "". "". $myrow["JokeDate"].""; $row_count++; } echo ""; $current_url = $_SERVER['PHP_SELF']; echo("" ."Add a Joke!"); } // end main else statement ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Object oriented??
Hi there, Is PHP an object oriented language. If not is it gonna be? Cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object oriented??
Yes of course...but was confused since some says it is so and some says it is not...So thought of asking the pros.. "Robert Cummings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 2004-11-06 at 21:44, Aalee wrote: > > Hi there, > > Is PHP an object oriented language. If not is it gonna be? > > Did you spend 10 seconds looking? > > Rob. > -- > .. > | InterJinn Application Framework - http://www.interjinn.com | > :: > | An application and templating framework for PHP. Boasting | > | a powerful, scalable system for accessing system services | > | such as forms, properties, sessions, and caches. InterJinn | > | also provides an extremely flexible architecture for | > | creating re-usable components quickly and easily. | > `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql networking ??
Hi guys, I have a small home network working with just 4 computers (PC's on WinXP Pro) connected through a switch just using the local ip's 192.168.0.1 and so on. And the netwok is working fine. I have installed MySQL on one computer and setup a database and installed MySQL on the other PCs aswell. But am having problem getting into the server computer where the databases are setup. Does any one of you know of any good tutorials out there how to setup a small network using MySQL using windows XP. I have come across some tutes, but most of them are on using Linux. Or any advice would be helpful. Thanks on advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql networking??
Hi guys, I have a small home network working with just 4 computers (PC's on WinXP Pro) connected through a switch just using the local ip's 192.168.0.1 and so on. And the netwok is working fine. I have installed MySQL on one computer and setup a database and installed MySQL on the other PCs aswell. But am having problem getting into the server computer where the databases are setup. Does any one of you know of any good tutorials out there how to setup a small network using MySQL using windows XP. I have come across some tutes, but most of them are on using Linux. Or any advice would be helpful. Thanks on advance aalee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql netwoking??
Hi guys, I have a small home network working with just 4 computers (PC's on WinXP Pro) connected through a switch just using the local ip's 192.168.0.1 and so on. And the netwok is working fine. I have installed MySQL on one computer and setup a database and installed MySQL on the other PCs aswell. But am having problem getting into the server computer where the databases are setup. Does any one of you know of any good tutorials out there how to setup a small network using MySQL using windows XP. I have come across some tutes, but most of them are on using Linux. Or any advice would be helpful. Thanks on advance aalee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why it doesnt work
Hi ive tried this script and it doesnt seem to work for me. I have typed exactly the same username and password in the script..it keeps on asking for the username and password..pls help...cud this be due to a setting in the php or apache server...am using php 4.3 and apache 1.3.33...the code is You're authorized! "; } } ?> cheers... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I fix that
Hi there everyone... I did a form to add data to a database and it works fine. Once the data is entered its gives a thankyou message. But the problem is, if I refresh this thankyou page, the data is entered again into the database. Why is it doing so. I couldnt think of a way to fix it. Help... cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php