Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2011
    Posts
    4

    Unanswered: Connecting VB, to php & MySQL?

    Hi all,

    I am a beginner in PhP and mysql.
    I am having trouble with connecting my Visual Basic Windows Program, to my php script.

    I am using Visual Studio 2010 and i am having serious troubles with this code.

    Heres My Code

    PHP Code:

    <?PHP

    //Database Information

    $dbhost = "localhost";
    $dbname = "MYDATABASE";
    $dbuser = "MYDETAILS";
    $dbpass = "MYPASS";

    //Connect to database

    mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
    mysql_select_db($dbname) or die(mysql_error());

    $username = $_GET['username'];
    $query = "INSERT INTO users2 (username) VALUES ('$username' )";
    $result = mysql_query($query);
    $rows = mysql_affected_rows($result);
    echo "good";
    ?>

    VB Code:

    Public Class Register

    Dim Downloaded As Object
    Dim INetControl As Object


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
    Downloaded = INetControl.OpenURL("http://76.164.196.202/~evenbala/sqltest.php?username=" & username1.Text)
    End Sub
    End Class

    My vb code, was taking from another post for vb6, i think. Basically what im looking to do is make a register form and soon a login form.... Connected to my websites database. And since my host doesnt have remote MySQL setup i am having a "ball ache" with this.

    Please Help Me With This, Before I Have No Hair Left
    Last edited by Geordie_Ben; 07-21-11 at 14:50.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •