Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,174,267 members, 7,891,252 topics. Date: Tuesday, 16 July 2024 at 10:34 AM

Someone Help Me With This. - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Someone Help Me With This. (1063 Views)

Java Proramers:java Assignment: Can Someone Help Provide A Solution To This / Can Someone Help Out On How To Add A Database To My Windows Forms App / Pls, Could Someone Help Me With Rc5 Encryption/decryption Algorithm Using Vb? (2) (3) (4)

(1) (Reply)

Someone Help Me With This. by pinnypanny(m): 1:57pm On Sep 10, 2007
can you help me with a simple php code to connect a login page to a (mysql) database. I need to creat a login page to a database.
Re: Someone Help Me With This. by SmartK1(m): 3:56pm On Sep 10, 2007
give a man fish and feed him for a day, teach him how to fish ,

i. visit www.google.com
ii. type exactly that ur question
iii. press Enter

the synonym for the above steps is called 'google it'

Meanwhile try this:


<?php
$myServer = "localhost";
$myUser = "your_name";
$myPass = "your_password";
$myDB = "examples";

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer"wink;

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB"wink;

//declare the SQL statement that will query the database
$query = "SELECT id, name, year ";
$query .= "FROM cars ";
$query .= "WHERE name='BMW'";

//execute the SQL query and return records
$result = mssql_query($query);

$numRows = mssql_num_rows($result);
echo "<h1>" . $numRows . " Row" . ($numRows == 1 ? "" : "s"wink . " Returned </h1>";

//display the results
while($row = mssql_fetch_array($result))
{
echo "<li>" . $row["id"] . $row["name"] . $row["year"] . "</li>";
}
//close the connection
mssql_close($dbhandle);
?>

from http://www.webcheatsheet.com/PHP/connect_mssql_database.php

Good luck

(1) (Reply)

How To Customize A Forum / Flask Mini Webframework / Programming Is Like Sex...

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.