New to PHP, am i doing it right?

Hi, I basically just started trying out things with php about 20 mins ago and having some trouble when trying to insert a new record into my database.
Ive set up a testing server but dont know if what ivé done is right:
[IMG]http://i25.tinypic.com/otm9uf.jpg[/IMG]
[IMG]http://i31.tinypic.com/i1zds1.jpg[/IMG]
and then im running the code in a php document, (by file\new\php) and inseting the php code in the body tag. Doubt this is correct?
When i go to live view it says,"records added the database" but when i check in phpMyAdmin the new record isnt there...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?PHP
    $user_name = "root";
    $password = "root";
    $database = "listing";
    $server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
    $SQL = "INSERT INTO tb_resturants (Name, Location, Food) VALUES ('Primi', 'jhb', 'Italian')";
$result = mysql_query($SQL);
mysql_close($db_handle);
print "Records added to the database";
else {
print "Database NOT Found ";
mysql_close($db_handle);
?>
<body>
</body>
</html>

Your firewall is off. That's good for now. Make sure that you Enable NAT Port Mapping Protocol in Internet/Internet Connections/NAT tab. Also, do you have a static IP on your machine? Or are you getting your IP via DHCP. This info is in the OS System preferences/Network/Advanced? tab. Then click on the TCP/IP settings.To get the ports forwarded correctly you'll need to set a static IP (manual) on your machine. But you'd think in all their wisdom that Real would have NAT enabled chat. Meaning, you should get out with DHCP and NAT enabled. No forwards needed.
Setting a static IP on your machine is relatively easy but affects other things on your network and you have to do a bit of planning to set it up.
In a nutshell:
Set up an IP address on your machine outside the scope of IP's being distributed by your router.
Map a port that resolves to that specific port.
I think you did it right above but didn't possibly have a static ip to resolve to.
Hopefully I am not confusing you with all this.

Similar Messages

  • News:The iTunes MiniStore: Apple Does the Right Thing

    Everyone upset about implementaton of iTunes MiniStore should read this:
    The iTunes MiniStore: Apple Does the Right Thing
    Just saw this. Maybe this will assuage people; maybe not. Seems like an honest attempt to make good to me.

    angeldandruff wrote:
    I concur! But I will comment more based on the terms of the store credit and validity.
    I agree..I'm not going to get ahead of myself and plan out what I want to buy before anything is really gone into detail. But I do say if it's just for the Apple online store (not iTunes store) then that Apple protection plan for the iPhone that I haven't got yet looks pretty nice. But if it's for iTunes as well then I'm getting $100 worth of 24 season 6, ringtones, and songs.

  • Why does the Right-click - "t" delete a bookmark on the bookmark toolbar, when Right-click - "t" opens a new tab elsewhere. The bookmark toolbar use Right-click - "w" to open in a new tab. Please change this to "t" to...

    Why does the Right-click -> "t" delete a bookmark on the bookmark toolbar, when Right-click -> "t" opens a new tab elsewhere in Firefox. The bookmark toolbar use Right-click -> "w" to open in a new tab. Please change this to "t" to... I keep deleting all my bookmark because you don't make the commands consistent!

    If you have accidentally removed bookmarks then use "Organize > Undo" in the bookmarks manager (Bookmarks > Organize Bookmarks) to get them back.<br />
    The Organize button is the first of the three buttons on the toolbar in the Library (Bookmarks Manager).<br />
    That only works if you haven't closed Firefox.
    [https://bugzilla.mozilla.org/show_bug.cgi?id=301888 Bug 301888] – Bookmarks cut instead of opened in new tab from Bookmarks Toolbar Folder
    (please do not comment in bug reports; you can vote instead)

  • Does Firefox has this option (which I may not know) to click on my bookmark, link, etc. where to open a new tab without doing this right-click, it is aggravating?

    Hello, I would like to use Firefox as my default browser, but the reason I still use the old Netscape Navigator is that that clicking on my bookmarks Firefox is not opening new tab. Does Firefox has this option (which I may not know) to click on my bookmark, link, etc. where to open a new tab without doing this right-click, it is aggravating?

    Install the addon
    Open Bookmarks in New Tab 0.1.2010043001.
    https://addons.mozilla.org/en-US/firefox/addon/open-bookmarks-in-new-tab/
    Restart on installation.

  • New group in Shared Services does not come up in projects?

    Hi All,
    I'm working on a system that has externalized security, and we use Hyperion Shared Services to add users to groups and assign filters to groups.
    I have just added a new group in the analkytic server in shared services, I have also provisioned it to have filter access of a particular DB.
    When I go to the projects folder and check the list of groups under the application, to look for this group so I could assign the filter, I dont find the group listed.
    Does anyone know what I am missing out on.
    Thanks in advance.
    Anindyo

    Hi John,
    I tried to delete the group and create a new group again:
    searched for the group, right clicked on it and clicked on Provision.
    Then I expanded the Analytic server tree to the left, selected server Access, and moved it using the arrow button.
    Then I expanded the DB name, there were "Provisioning Manager", "Application Manager" and "My Role".
    I expanded the Tree of "My Role" and found "Calc", "Filter" and "Read".
    I expanded the tree "Filter", and found Start/Stop Application.
    I selected "Filter" (not Start/Stop Application) and moved it to the second list on the right using the Arrow button.
    Then I clicked on the save button.
    Now I expanded the Projects Folder:
    Clicked on the DB to which I provisioned this group.
    It showed the list of users and groups to the right.
    I selected groups in the drop down.
    Clicked on refresh, but the new group does not appear.
    Please let me know if I missed out on anything.
    Thanks for the response,
    Regard,
    Anindyo

  • I am trying to send photos to the cloud from my phone to my iPad but they are not appearing in the stream. I have read the instructions and I think I am doing it right or am I missing a part of the process?

    I am trying to send photos to the cloud from my phone to my iPad but they are not appearing in the stream. I have read the instructions and I think I am doing it right or am I missing a part of the process?

    HI,
    Have you done this before ? And if so, is photo stream turned on on your iphone and ipad. and as Alfred DeRose pointed out they must both on the same icloud account.
    If you're new to this, you might want to do some research. Photo stream is different from camera roll and albums. Many have been on this sight looking for their photos stored in icloud after restore, etc. and they're not there. Also, after thirty days icloud deletes your photos from photo stream.
    So if you're not aware, you might want to google your question. We're using the camera connection kit soon and I am learning about it. From all I've read, I'm also not the biggest icloud fan. I use dropbox. We plan to put photos taken on ipad with a camera/iphones into albums on the ipad. We'll keep all on the sd card until (and after) they can be uploaded to a computer.
    An example of an article we can learn from -
    http://www.macobserver.com/tmo/article/how-to-understand-and-work-with-your-iclo ud-photo-stream
    Hope this helps.

  • My NEW iPod Classic 160GB (2013) does not sync with iTunes on my PC Windows 7 Starter

    My NEW iPod Classic 160GB (2013) does not sync with iTunes on my PC Windows 7 Starter. I have like 1975 songs and some videos, but also somtimes the PC does not recognize it, sometimes it does, either ways I can't get my music in the ipod.

    yes i have a solution to my problem only because of a recent phone call from apple they were great.......... in the right hand side of itunes my i pod was displayed.  click on the ipod symbol........at the top of the page you will see summary,,,,,,music,,,,,,movies,,,,,,tvshow,,,,,,photo,,,,,on this ipod.
    click on music check mark music done and sync
    problem solved
    thanks apple

  • Can someone please verify if I'm doing this right?

    OBJECTIVE:
    Write a program that asks a user to enter in one input, either "true" or "false". Simulate the NOT gate in this program. After the user has entered in an input, ask them if they would like to continue or not; continue the program if they reply 'y' and stop if they reply 'n'.
    I think this program is pretty easy, but I am not sure if I am doing it right. My understanding of the NOT gate is that if someone enters in something, it must be the opposite. So since the user is only being asked one question, and to only answer "true" or "false", the answer would be opposite to what they input right? Below is the source code of my program for the above objective, please check to see if it is right :).
    // The "Chap3Program12" class.
    import java.awt.*;
    import hsa.Console;
    public class Chap3Program12
        static Console c;           // The output console
        public static void main (String [] args)
            c = new Console ();
            String input;
            char response;
            do
                c.println ("Please enter either 'true' or 'false'");
                input = c.readString ();
                c.println ();
                if (!(input.equals ("true")))
                    c.println ("You have entered " + input + ".  The result is true.");
                else
                    c.println ("You have entered " + input + ".  The result is false.");
                c.println ();
                c.println ("Do you wish to stop y/n?");
                c.println ();
                response = c.readChar ();
            while (response != 'y');
            c.println ();
            c.println ("This program has terminated.  Have a nice day!");
        } // main method
    } // Chap3Program12 class

    Sorry, I didnt post that properly, let me repost it.
    I compiled it and it works, but Im not sure if i am using my NOT gate properly, and if my program is satisfying the Objective.
    if (!(input.equals ("true")))           
    c.println ("You have entered " + input + ".  The result is true.");           
    else           
    c.println ("You have entered " + input + ".  The result is false.");           
    }If not true = false, then that means my if statement is wrong? My if statement says: If input is NOT equal to true, then the result is true. Shouldn't the result be false then? If not false = true, then that means my statement after else needs to be changed, because if not false = true, the result should be true, not false?

  • Need help with an unusual workflow - Am I doing this right?

    Thanks for reading, I shot my footage in HD 720pn on the HVX200. The final export needs to be fitted into a 352x288 frame 'uncompressed' which I will hand to my client who will convert to .wmv and .h264 for viewing on a PC and their video playback device (hence the odd 352x288 frame size).
    So this is what I'm doing, I just need to know if I'm doing this right before I hand it to my client so I can avoid problems with formats ect.
    -First I imported the footage from the P2 card and edited it in it's native format and timeline.
    -Once finished, I export to its native format (QuickTime, Current Settings, self-contained). This creates a file size of 1.7GB.
    -I create a new sequence at 352x288 with Uncompressed 10 bit 4:2:2 as the codec (I just guessed here) and imported the self-contained video.
    -I shrink the video to fit the smaller frame and then render and export again using the current settings (352x288 with Uncompressed 10 bit 4:2:2 as the codec). Its now 4.4GB (Why is it bigger than the larger framed original file?)
    The video looks great but I'm still worried about whether my client will be able to play it back via QuickTime on PC and I'd like the file size smaller so it's easier to deliver.
    Any help to simplify or correct this workflow would be greatly appreciated.
    LP

    You don't need to go through the double export process. You can either place the edited and rendered 720p sequence in the 352x288 sequence and then export, or you can scale the image down on export in the QuickTime Conversion export module, or in Compressor. Any QuickTime can read uncompressed video.

  • 64 bit Ubuntu 10.10 FF 3.6, top menu does NOT function nor does mouse right-click, all other applications O.K.

    Running 64 bit Ubuntu 10.10 upgraded from 10.04
    Running latest 3.x.x Firefox
    On rebooting this morning the top menu does not function at all, nor does mouse right-click.
    Did 'complete removal' in Synaptic and reinstall to no avail.
    Thunderbird and Google Chrome functioning fine.

    Fixed!
    open a new instance of Firefox (ctrl-N). You will notice all is working now. Close the old instance, so whatever Firefox remembers as your last instance is the new, good one. Worked for me. This problem seems to have been around a while already, this fix dates from November 2010...

  • Head tags in template generated pages, am I doing this right?

    http://www.saracenlanding.com/testpage.html
    I experienced the dreaded " ... locked by ... " error message when trying to insert keywords in a page generated by a dwt file. I went to the forum and found this information:
    http://forums.adobe.com/message/50942#50942
    So I enclosed the head in the cut, pasted and edited editable region markup and it seems to work.  Then I used the insert html>head tags>keywords to insert some keywords and that worked, but it put the keywords at the very top of the page. As I recall, the meta info is supposed to be inside the head section, so I cut and pasted the keyword markup into the head section, I had isolated with the editible markup and it seems to work.
    Not being the sharpest knife in the drawer on these matters, did I do this right? Have I set a trap for myself which will spring later on? Is there a better way? I only know to ask those who know more than I.
    Thanks in advance,
    Joe

    So, as far as setting it up - would I use the cd
    included with the Airport box or the existing apps on
    my computer?
    Use the CD. There is newer software on it.
    Does it matter which computer I set up
    first? If I do the airport setup utility on the old
    mac, will the new mac automatically recognize it when
    I turn it on?
    Both macs should connect with out a problem. It doesn't matter which you setup first.
    The other thing that was running through my head was
    that it would actually be nicer to put the Airport
    base station in my office (reduce the clutter of
    stuff in the living room), but since the old mac
    doesn't have a wireless card (and I don't even know
    if I can get one anymore), is there some kind of USB
    adapter that would work to access the signal? I've
    seen a bunch of them, but most of the reviews say
    they're not very mac-friendly.
    You probably won't find a mac USB adapter becuase there usually aren't mac drivers. You could bring the old computer to the Apple Store and they can install a wireless card in there.
    15 PMB C2 Duo   Mac OS X (10.4.8)   PPC Mac Mini

  • HT201956 Why does the right side of the menu bar disappear or blink when I turn on my epson XP200 printer?

    Why does the right side the menu bar disappear or blink when I turn on my epson XP 200 printer?

    I have also been experiencing the same problems. Mac user since 1991. I own various machines but this particular problem lies with a MacBook Pro 2008 using 10.5.4
    The laptop has two users. One is fine while one is not. A new user was created but upon logging in for the first time the right hand side of the menu bar blinked off and on just like the existing user. No hard drives have been connected. All files backed up via drag and drop wirelessly.
    Since this development I have been unable to get to my iDisk; it might be related or coincidental. Last night I re-entered my .mac/MobileMe account details whereupon I was presented with a message saying the machine had not synced before. Not true. It had been syncing automatically since the day of purchase March 2008. I wonder if there is a connection between somewhere deep down in the Library, updated versions for 10.5.4 and MobileMe. Somewhere along the line a combination of events triggered the tool bar to start blinking...
    It's strange how one user is fine (seldom used and DOES NOT have a MobileMe account) while the main one, me, is not fine (used heavily throughout the day and DOES have an active MobileMe account).
    At this point, I don't intend to re-install and start all over again (I've done this so many times with other machines over the years that I was hoping those days had finally gone based upon Apple's brilliant recent advancements).
    Any help or comments will be welcome.
    Cheers!

  • 309n AIO stopped printing black bought new printhead from HP still does not print black???

    309n AIO stopped printing black bought new printhead from HP still does not print black??? tried the "cleaning" process finally bought new cartridge carriage cost me $50 from HP still dies not print black> i believe it is a software issue. Any help would be appreciated.

    Hi Jokurone,
    I understand you have a Photosmart C309n that has stopped printing black. I'm sorry to hear this has been happening, but I will do my best to assist you.
    I would recommend following this Print Quality document as it will help determine whether the issue is with the hardware or the software. If your test pages come out with black then it may very well be a software issue. However, if the test pages come out with no black still it's a hardware issue with the printer. In that case if you follow through that document and the black still isn't printing then you can have a look at Bob_Headrick's post about soaking your printhead.
    Hope this helps, have a great day!
    Please click “Accept as Solution ” if you feel my post resolved your issue, as it will help others find the solution faster
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    **MissTeriLynn**
    I work on behalf of HP

  • My new Dell Win 8 PC does not recognize my CS5 installation disk.

    My new Dell Win 8 PC does not recognize my CS5 installation disk.
    I'm willing to download from the web, but I can't find the right site.

    You can download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS5: http://prodesigntools.com/all-adobe-cs5-direct-download-links.html

  • External video projector - How can I hook up my Mini DisplayPort to DVI Adapter onto my new MacBookAir if the machine does not have a mini port (but only 2 USBs and 1 Thunderbolt)?

    Hi
    How can I hook up my DVI Adapter onto my new MacBookAir if the machine does not have a mini port (but only 2 USBs and 1 Thunderbolt)?
    Is there a DVI adaptor already for Thunderbolt?
    Thanks,
    JFR

    The Mini Display port and Thunderbolt port use compatible connector bodies. Your current Mini Display to DVI or VGA adapter will still work as before on the newer Thunderbolt capable machines.

Maybe you are looking for

  • Problem with using swc files in Flash Player 10

    I have two Actionscript projects in Flex. One is using Flash Player 9 the other is using 10.  Both projects use the fl classes specifically FLVPlayback. In the Flash Player 10 project I am using the recently released version 2.5.  Both players use in

  • Problem with international chararcters in senders email

    Hello, We have a customers who sends batches of email to internation people with CFMAIL. So there are international characters involved in the emailadresses, like: willem.solbö[email protected] frédé[email protected] jean-franç[email protected] These

  • I have a ipad2 but doesnt exist facetime icon. how can i install it?

    i tried to reinstall ios few times but still no facetime icon. really wired and fed up with...

  • Variant in module pool pragram

    Hi, In Reports , we r using variant to save the input paramerters. Like that i want in Module pool program also . Plz give the details Regards, Rani.

  • My macbook pro simply dies when the battery runs low

    I've got a MBP, running 10.6, and as of a few months ago, whenever the battery gets low to just a few percent, the computer simply shuts off.  It used to go to sleep, which would allow me to plug it in and restore to where I was when it went into sta