Search found 14 matches
- Mon Dec 26, 2011 9:41 pm
- Forum: PHP
- Topic: mysql_fetch_assoc() expects parameter 1 to be resource...
- Replies: 2
- Views: 856
Re: mysql_fetch_assoc() expects parameter 1 to be resource..
thanks so much! that got it to work in a minute! as for having it all in a back-end file, I'll do that now I guess
- Mon Dec 26, 2011 5:07 am
- Forum: PHP
- Topic: mysql_fetch_assoc() expects parameter 1 to be resource...
- Replies: 2
- Views: 856
mysql_fetch_assoc() expects parameter 1 to be resource...
I have one last small issue.. I've been trying to figure it out for hours now trying many different things. This exact same script for a different table works perfectly on other pages. I'm getting this error message: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean [...] on l...
- Sat Dec 24, 2011 11:59 pm
- Forum: PHP
- Topic: PHP edit profile page does not update database
- Replies: 6
- Views: 1410
Re: PHP edit profile page does not update database
Thanks a lot for pointing the error message out (I didn't define the array variables properly) here's the fully functional script if anyone needs it <?php session_start(); $link = mysql_connect('localhost','root','1234') or die('Cannot connect to database'); mysql_select_db('youtube'); function fetc...
- Sat Dec 24, 2011 6:54 pm
- Forum: PHP
- Topic: PHP edit profile page does not update database
- Replies: 6
- Views: 1410
Re: PHP edit profile page does not update database
I scrapped much of the code. The database updates perfectly, but after I click on update, depending on which fields I modify, the fields turn to some strange code, such as <br /><br /><font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'><br /><tr><th align=...
- Sat Dec 24, 2011 6:37 pm
- Forum: PHP
- Topic: PHP edit profile page does not update database
- Replies: 6
- Views: 1410
Re: PHP edit profile page does not update database
Well I just added echo mysql_error(); to my code and it says: Unknown column 'bob123' in 'where clause'
Yet bob123 is the username.
I changed my code to this, as you recommended
Yet bob123 is the username.
I changed my code to this, as you recommended
$query = mysql_query("SELECT `id` FROM `user` WHERE `username`=$username")Thanks!
- Sat Dec 24, 2011 9:00 am
- Forum: PHP
- Topic: PHP edit profile page does not update database
- Replies: 6
- Views: 1410
PHP edit profile page does not update database
I am almost done the edit profile page on my site. I have been following this tutorial: http://www.youtube.com/watch?v=2gcKp6hcSAY For some reason, when I click on update, the page simply refreshes and nothing is updated in the database. Do you have any idea why? Thanks again for any help. Relevant ...
- Fri Dec 23, 2011 12:05 am
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
Thank you for the help. I got it to work by inserting
$link = mysql_connect('localhost','root','1234') or die('Cant connect to database'); mysql_select_db('youtube');on top. It was quite obvious now that I look back at it.. I might have copied his code wrong. Thanks again
- Thu Dec 22, 2011 9:47 pm
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
Oh thanks. It say no database selected. And my database is called user
- Thu Dec 22, 2011 8:59 pm
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
$result = mysql_query('SELECT `id`, `username` FROM `user`');
gives me a ton of error messages and does a huge loop like I said. hmm what to do
- Thu Dec 22, 2011 8:39 am
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
It gives a strange loop again. I tried pretty much every syntax now. I'm off to bed though. Again, thanks for the help. Here's where I'm at now: user_list.php: <?php include('core/inc/user.inc.php'); ?> <html> <head> <title>Registered Users</title> </head> <body> <div> <?php foreach (fetch_users() a...
- Thu Dec 22, 2011 8:23 am
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
Still not working.. that and several other combinations I've tried seem to be performing an infinite loop. I'm getting a top of error messages that keep generating for the same line. Also, is there a difference between ' and the ` you are using (I believe it's the French apostrophe)? Mind you I've t...
- Thu Dec 22, 2011 8:13 am
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
It is giving me the same error, both with and without the outer ' :/
- Thu Dec 22, 2011 7:45 am
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
Re: PHP login page errors
lol pretty embarrassing. Thank you for that Okay sorry I found some more errors on my own. For user_list.php I was supposed to add include('core/inc/user.inc.php'); instead. But what does "Parse error: syntax error, unexpected T_STRING in C:\wamp\www\core\inc\user.inc.php on line 4" mean w...
- Thu Dec 22, 2011 6:43 am
- Forum: PHP
- Topic: PHP login page errors
- Replies: 20
- Views: 2685
PHP login page errors
Hi, I have been following these videos http://www.youtube.com/watch?NR=1&feature=endscreen&v=dsgnKTuQeMw of yours and have been unable to get the code to work. include('core/init.inc.php'); ?> <html> <head> <title>Registered Users</title> </head> <body> <div> <?php foreach (fetch_users()) as...