Search found 58 matches

by twiggy
Tue Jun 14, 2011 7:35 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

Sorry guys i was very tired last night lol :D I added some code to my register page that I have no idea why :shock: that was stopping it, all is good now!
by twiggy
Tue Jun 14, 2011 6:47 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

Out of interest if I have entered my DB details incorrectly would I receive an error? As of now I'm not getting anything just the page resets.
by twiggy
Tue Jun 14, 2011 6:12 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

ok I got it!

I put:

$total = mysql_query("SELECT COUNT (`user_id`)


and it should be:

$total = mysql_query("SELECT COUNT(`user_id`)


Who would have thought a space after COUNT could cause all that :)

Now time to see why its not writing to my DB
by twiggy
Tue Jun 14, 2011 6:04 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

ok kalipsso I tried your text again, I have no idea why it looks exactly the same as mine word for word (see my copy and paste below) but I no longer get that error message but nothing is sent to the database? The form resets and the page reloads but nothing is showing in the db?
by twiggy
Tue Jun 14, 2011 5:59 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

Hi Tino changed it to this: [syntax=php]<?php // Checks if the given username exists in the database. function user_exists($user){ $user = mysql_real_escape_string($user); $total = mysql_query("SELECT COUNT (`user_id`) FROM `users` WHERE `user_name` = '{$user}' "); return (mysql_result($to...
by twiggy
Tue Jun 14, 2011 5:58 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

oops sorry Tino I miss read your post lol I will change them over now
by twiggy
Tue Jun 14, 2011 5:58 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

Hi there, I did that but now get this:

Fatal error: Cannot redeclare user_exists() (previously declared in C:\xampp\htdocs\user_system\core\inc\user.inc.php:4) in C:\xampp\htdocs\user_system\core\inc\user.inc.php on line 27
by twiggy
Tue Jun 14, 2011 5:29 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

Re: PHP Login: expects parameter 1 to be resource, boolean g

Hi there, this doesn't seem to be the case I have used ' on all my table and field names, it actually took me a while to find the ` on my keyboard lol So its not that, I have added echo mysql_error(); to the end of each mysql statement but it doesn't show anything different ? Still: Warning: mysql_r...
by twiggy
Tue Jun 14, 2011 2:18 pm
Forum: Suggestions
Topic: Statistics
Replies: 2
Views: 976

Statistics

One thing I have always been interested in is the statistics for a site. Your page view if a grate example to start with, so how about expanding on this to show unique visits, browser, location, time on site, bounce rate ect

This would be cool, if at all possible.
by twiggy
Mon Jun 13, 2011 11:16 pm
Forum: Tutorials
Topic: PHP Login: expects parameter 1 to be resource, boolean given
Replies: 12
Views: 11351

PHP Login: expects parameter 1 to be resource, boolean given

I started a new thread encase other people are having the same problem, makes it easier to find in a search Im getting this error: Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\user_system\core\inc\user.inc.php on line 7 Code: user.inc.php [syntax=php]<...
by twiggy
Mon Jun 13, 2011 10:31 pm
Forum: Introductions
Topic: Hi there im new!
Replies: 5
Views: 1254

Re: Hi there im new!

Hi everyone thank you for your welcoming comments, looks like I could settle in well here.

Now working my way through your video tutorials as we speak, well type! :)
by twiggy
Mon Jun 13, 2011 10:11 pm
Forum: Tutorials
Topic: PHP Login Strict Standards error
Replies: 6
Views: 1224

Re: PHP Login Strict Standards error

Hmm I will decide that once I know and understand more about PHP, I guess there is thought behind it, rite or wrong. I'm just thinking a head in to the future when I share my scripts and pass them around I will want to make sure they work across many environments and platforms as possible so it look...
by twiggy
Mon Jun 13, 2011 9:50 pm
Forum: Tutorials
Topic: PHP Login Strict Standards error
Replies: 6
Views: 1224

Re: PHP Login Strict Standards error

For anyone following this at a later date and wants to give this ago here is the code for the next part of the tutorial: [syntax=php] <?php session_start(); $split = explode('/', $_SERVER['SCRIPT_NAME']); $page_title = substr(end($split), 0 ,-4); ?> [/syntax] Then simply call <?php echo $page_title ...
by twiggy
Mon Jun 13, 2011 9:47 pm
Forum: Tutorials
Topic: PHP Login Strict Standards error
Replies: 6
Views: 1224

Re: PHP Login Strict Standards error

Yeah that works grate thanks!

Without trying to poke a stick in a hornets nest, would It be wise to carry on doing it the way PHP wants us to, in strict mode, or is it just not worth the hassle and disable it?
by twiggy
Mon Jun 13, 2011 9:33 pm
Forum: Tutorials
Topic: PHP Login Strict Standards error
Replies: 6
Views: 1224

PHP Login Strict Standards error

Ok I'm working through the PHP login series and on the first video I ran in to a problem writing: [syntax=php]echo end(explode('/', $_SERVER['SCRIPT_NAME']));[/syntax] It gave me this error: Strict Standards: Only variables should be passed by reference in C:\xampp\htdocs\user_system\core\init.inc.p...
by twiggy
Sat Jun 11, 2011 11:18 pm
Forum: Introductions
Topic: Hi there im new!
Replies: 5
Views: 1254

Hi there im new!

Hi guys, I have been creating websites for well over 8years and never really bothered to learn any backend language until about to years ago when I picked up RoR which is simply awesome. I have worked with PHP and understand the basic principles but have never really had a real crack with it, so her...