Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL, VB6 and HTML

Status
Not open for further replies.

likelylad

IS-IT--Management
Jul 4, 2002
388
GB
Background Information:
I have a MySQL database sitting on a server.
At the moment I am using Access 97/2000 and myODBC to input data into the database.
One of the problems that I am now currently having is the amount of people using the database, and Access is not coping too well with the pressure.

What I would like to do:
Instead of using access, I would like to switch over to having a web interface to the database.
Using HTML I can set up an initial form asking for username and password.
Unfortunately this is all the skills I have.
First of all I would like to have this form check the username and password against a table in the MySQL database.

If it validates the password, it opens a htm form (designed using DHTML in VB6).

If it does not validate the password, then an error message is given

(a)The server the MySQL database sits on is called Server1
(b)The database name is globaldata
(c)The table is called login
(d)The 2 fields in the table are called user and password

As if this wasn't enough to ask anyone, I would also like all connections to the database to be DNSless

Thanking anyone in advance for any help given.
 
if you are not doing so already I would recommend using PHP server side scripting to do this. It works really well with MySQL and is also free of charge. The PHP installer is available from
php is like ASP from microsoft but in my opioion a whole lot better.

once you have got PHP running on your server copy this into a file and execute it through a browser:

<%
phpinfo();
%>

this will check to see if the php installation worked or not.

to make a connection to your database use this:

<?php

$dbname=&quot;localhost&quot;;
$dbuser=&quot;root&quot;;
$dbpass=&quot;&quot;;
$dbtoconnect=&quot;name_of_your_mysql_database&quot;

$conn=mysql_pconnect($dbname,$dbuser,$dbpass);

if (!$conn) {
echo &quot;Couold not connect to the database. Please contact the system administrator&quot;;
exit;
} else {
//made connection to database
mysql_select_db($dbtoconnect);
}

//setup the query to execute against the database
$strQRY = &quot;SELECT * FROM YOURTABLE&quot;;
//execute the query
$objWhatever = mysql_query($strQry);

//loop over the result set
while ($row = mysql_fetch_array($objWhatever)) {
//print out the result from one of the fields in your db
echo $row[&quot;field_in_your_table&quot;] . &quot;<BR>&quot;;
}
?>

if you want to provide the names etc of your database, table and fields, I'll get you started on a login system

hope this helps !
 
Hi arperry

Thanks very much for getting me started on this.
It will probably be a few days before I will get a chance to get back to you.

In relation to the login system, Is this the information you need??

(a)The server the MySQL database sits on is called Server1
(b)The database name is globaldata
(c)The table is called login
(d)The 2 fields in the table are called user and password
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top