|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Community > Development Tutorials > Get it to run |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|