Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-14-2004, 02:43 PM   #1 (permalink)
Namraw
Registered User
 
Join Date: Sep 2004
Posts: 2
Namraw is on a distinguished road
login session help please

Hi i was tryin to use the Login Session code for my site and i got it working and everything but somethings bugging me and i dont understand whats its all about

it alwyas seems to show "Can't connect to db" even wen u can login using the user and pass i've setup i was wondering why didn't go awy or is still there cos there no point of it i think.

PHP Code:
<? 
// Login & Session example by sde 
// connect.php 

// replace with your db info 
$hostname="localhost"
$mysql_login="root"
$mysql_password=""
$database="test"

if (!(
$db mysql_connect("$hostname""$mysql_login" "$mysql_password"))) 

  print(
"Can't connect to mysql.");     

else 

  if (!(
mysql_select_db("$database",$db))) 
  { 
    print(
"Can't connect to db."); 
  } 

?>
Click here for rest of tutorial

thanks
Namraw
Namraw is offline   Reply With Quote
Old 09-14-2004, 03:25 PM   #2 (permalink)
Namraw
Registered User
 
Join Date: Sep 2004
Posts: 2
Namraw is on a distinguished road
Appoligise

i do appoligse for postingthis i now realise what i've done wron but was wondering whether ne1 has used this code and could tell me y the enter password comes up wen u click on link_1-3 after login in

Regards

Namraw
Namraw is offline   Reply With Quote
Old 09-14-2004, 03:26 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
1. are you developing locally or remotely?
2. "even wen u can login using the user and pass" <-- does that mean you can login from the mysql command line? if not, explain please.

when you can't connect to the db, it is usually permissions.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check if session variable is null? sde Java 3 07-07-2004 12:27 PM
session_start(): Cannot send session cookie learntophp PHP 2 06-18-2004 07:51 AM
narrowed down login trouble trevor PHP 7 01-18-2003 05:50 PM


All times are GMT -8. The time now is 07:36 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting