If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Connecting VB, to php & MySQL?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-11, 13:46
Geordie_Ben Geordie_Ben is offline
Registered User
 
Join Date: Jul 2011
Posts: 4
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 13:50.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On