The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other web<-->database, how do you interact with to do them?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #30627

    not just copy and pase,I want finding some beautiful things. before two years,I learn to database from a school ,but you know,I still not understand how is it , what database process is? Just do some adddeleteselect?another one. And now, I learn some web skill, csshtml .ex. I discover web is very beautiful,like your web. i can’t link together with database and web,so can i learning knowledge systematically?


    google php database tutorials. You will learn all you need to do a database over the web. You can also try They have video tutorials, but you will have to pay for them. You can also check the video section on this site. There might be some there


    Or use youtube, do not underestimate the knowledge you can get from there


    Lets say you have a database named testdb, with a username of admin and a password of admin1.
    With the following PHP code, you can connect to the database, which is required if you want to add or delete stuff in it.

    mysql_connect("localhost", "admin", "admin1") or die(mysql_error());
    echo "Connection to MySQL established";
    mysql_select_db("testdb") or die(mysql_error());
    echo "Also connected to the testdb database";

    The following code will insert some stuff in the testdb database. Lets say that database has a table in it named tableone.

    mysql_query("INSERT INTO tableone (city, country) VALUES('New York', 'USA' ) ") or die(mysql_error());

    This (city, country) code means stuff will be inserted in those columns, and the stuff will be ('New York', 'USA').

    The line die(mysql_error()); means that it will the mysql error if there is any.

    You can find some very handy information here:


    thank you for your idea

    Rob MacKay

    I would look into using a PDO method too – so add that to your search :D

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Other’ is closed to new topics and replies.