Hi, I am currently trying to make a part for my user driven website where one user can subscribe to another and whoever they have subscribed to is echoed back on there profile page.
my users table structure is: id username password and my subscription table is: id user_id follow_id
i am currently trying to query the logged in users subscriptions with this sql_query
$subsQuery = mysql_query("SELECT U.username FROM users AS U INNER JOIN subscription AS Sub.follow_id=U.id WHERE Sub.user_id=".$ID); $ID being the logged in users id.
However when trying to echo this on the page using this bit of php:
<? while ($subs = mysql_fetch_assoc($subsQuery)) { ?><br /><br />
<? echo $subs['username'] ?>
<? } ?>
it throws back this error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/avince/public_html/users/user.php on line 53
Any help would be much appreciated!
form class help (oop php5)
Hidy Ho Neighbors,I'm forcing myself to learn oop/classes for php5. It seems like a good idea for repetitious coding such as with forms. I've been through the oop tutorials here and elswhere in
Default TimeZone
The server I'm working with is hosted in America so all times inserted into the database are coming out 5 hours differen't to what I want them to. I attempted placing the following in my Header
Unidentified index error in a simple form
I have been trying to make an HTML form that is handled by a PHP script. So far my attempts to get it to work have proven fruitless.I'm referencing the Visual Quickstart Guide for PHP to learn PHP,
Progress bar for webpage
Hi,I want to implement a progress/waiting bar on my webpage - exactly the same thing that the Microsoft Update web page uses when your PC is being searched for available updates (the green bar that
How to get variable value on next page
Hello friends i am working on payentry page ..there i have this code......... Code: $str="select MAX(PSRN) from paymajor";$result=mysql_query($str) or
Fatal error: Call to a member function fetchrow() on a non-object in C:xamppht
okay i have this query and everytime i add `item_id`=? to it... it gives me the error in the title...Code: $query = $db->execute("select * from items where `player_id`=?,
Page Reload
I am having issues getting a page to reload after I submit data to a database. This form should input data to a DB and then I want it to reload and list what is in database. I have gotten it to
Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I have hard time contacting our DB and I would like to be able to kill the process myself, whithout
wav to mp3 + goDaddy
I need to convert wav files to mp3s. From what I have found so far one way to do it is to have my PHP script call exec to some mp3 encoder on my host's server. I am using a GoDaddy shared Linux
Session login issue
I'm wondering how to fix a problem I'm having with a session-based login systemSay I go to http://www.website.comThe page that processes the login then returns the now-logged-in user to