Someone Help Me With This.

A Member? Please Login  
type your username and password to login
Date: December 05, 2008, 05:27 AM
268336 members and 165349 Topics
Latest Member: roorbereibusa
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming (Moderator: Dual Core)  |  Someone Help Me With This.
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Someone Help Me With This.  (Read 149 views)
pinnypanny (m)
Someone Help Me With This.
« on: September 10, 2007, 01:57 PM »

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.
Smart K. (m)
Re: Someone Help Me With This.
« #1 on: September 10, 2007, 03:56 PM »

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:

Quote
<?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");

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

//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") . " 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
 Submit Your Quotations For A Pabx Installation Job!  Business Process Execution Language (Bpel) Help  Php Programmers Please!  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.