Development Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsCommunityDevelopment Tutorials

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 7th, 2003, 02:52 PM
phpnewbie phpnewbie is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Netherlands
Posts: 8 phpnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Get it to run

Hi all,
I'm a complete newbie to php and mysql, which make things a little bit difficult for me.
I have read the article, and overcame some problems (thanks to google :-))
Now I'm up to the point where I think my flaw is in my connection to the database.
I have setup a registration form, and I see that the data I typed is passed correctly to the registration.php script by adding some echo lines in the script.
However, my sql_email_check and my username_check don't return any value at all.
My flaw, (as I believe) is in my db.php script which I was unable to find through the website, so I just guessed around somewhat and came up with :
"
<?php
$dbServer = "localhost";
$dbUser = "admin";
$dbPass = "Mypassword";
$dbName = "storeitonline";
function ConnectToDb($server, $user, $pass, $database)
$s = @mysql_connect($server, $user, $pass);
$d = @mysql_select_db($database, $s);
if(!$s || !$d)
return false;
else
return true;
}
function GetCartId()
{
if(isset($_COOKIE["userid"]))
{
return $_COOKIE["userid"];
}
else
{
session_start();
setcookie("uderid", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
}
?>

Can somebody point me to a better db.php example script ?
Or can anybody tell me what I'm doing wrong ?
NOTE: The table wich holds my data (at this point still empty) is called 'users', and I guess my flaw is in there.

If you want to check what the page looks like, please check out :
http://www.storeitonline.nl/test/veilig/join_form.html

Reply With Quote
  #2  
Old December 7th, 2003, 03:53 PM
phpnewbie phpnewbie is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Netherlands
Posts: 8 phpnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Got it to run

Hi all,
no need to break your minds on this one.
It was simpler than it looked to me.....
The following code for my db.php script was good.
Besides, this item probably stood 'in the blue' as I didn't refer to the article that I was trying to copy.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsCommunityDevelopment Tutorials > Get it to run


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway