Jump to content

mike008

Members
  • Posts

    10
  • Joined

  • Last visited

Reputation

0 Neutral

About mike008

  1. Once I have inputted data via the form below, named "persons.php", it sends data to the database, and then I get the page named "insert.php" coming up leaving the message: "1 record added". What code do I need to put in the "insert.php" code to have it return to the "persons.php" page. I tried to put in: include("persons.php"); but when I refreshed the page, it inputs the data into the database a second time. .......................................................................................................................... "persons.php" code: Firstname: Lastname: Age: ...................................................................................................................... "insert.php" code: <?php $con = mysql_connect("localhost","root","root"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); $sql="INSERT INTO Persons (FirstName, LastName, Age) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?>
  2. Thanks for all of your help so far..........I am plugging away with mixed results. At the moment I am following a tutorial at PHP MySQL Introduction It works ok, but on this page: PHP MySQL Select it shows a PHP script which "displays results in a HTML table". The tutorial does not tell me what to name this or where I should put the code or how I link to it. So far it tells me to create a persons.php file and an insert.php file which I have done. Any suggestions would be welcome. Cheers, Mike.
  3. When I have the XAMPP Control Panel Application running and go to http://localhost, why does it comes up with IIS7 Information Services and not the Welcome to XAMPP page?
  4. I have just downloaded Virtual Appliances LAMP 1.0.180 , and all I have is a VHD and a VMC file. How am I supposed to install it from there? Shouldn't there be a setup.exe?
  5. Thanks Steve, and Kim, it's all beginning to make sense...........(I think.......) Mike.
  6. Hi, So you are saying I can't use the MySQL thats on my home PC with the PHP on the hosting company that I use with my website,
  7. No, that didn't work.
  8. Thanks for your replies! After downloading MySQL, I started using the W3Schools Online Web Tutorials tutorial on PHP MySQL and I can't even get past the first chapter.......... I tried the following to connect to MySQL: <?php $con = mysql_connect("localhost:3306","Mike","m*******"); if (!$con) { die('Could not connect: ' . mysql_error()); } // some code ?> Mike being my computer name, mypassword is m******* as used on MySQL. I get the following message: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/fhlinux160/m/maximumrnb.com/user/htdocs/test.php on line 5 Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) What am I doing wrong?
  9. Thanks for your reply! I have viewed similar threads and one listed the following: web images - fireworks js/html/css - dreamweaver asp.net - visual studio or visual web developer express php - eclipse Would I be right in saying that Eclipse is used instead of mySql, or am I way off the mark. I downloaded mySql, but the method of inputting the information to create databases etc seems a bit antiquated, like going back to DOS! Thanks for your time.
  10. I would like to persue a career in Web Develpment. I have built a couple of basic web sites in the last couple of years for friends, using Dreamweaver, Photoshop, Flash and Fireworks, but now I would like to get a bit more serious. I have looked at various vacancies for Web Developers, and many of them ask for experience in ASP .net C# and VB, Classic. ASP, VB6, XHTML, XML, Java Script, IIS, and others. Obviously I need to learn some of this stuff, but it is going to take a while. Basically, what I want to know is where should I start? Does anyone know what I should learn first to give me a good foundation and maybe get me some kind of employment? Thanks, Mike.
×
×
  • Create New...