Hello All,
Ran into another problem and would appreciate some help! I have two databases, publications_db (pub_id, title, author, yr, journal, num_pages) and activity_db(member_id,pub_id,date). Basically, when a user is logged in, I want to have an option for them to view the publications they have submitted to the publication database.
In pseudocode, I want to display * from publications_db where the session_id (currently logged in user) matches the activity_db.member id AND activity_db.pub_id matches publications_db.pub_id
Below is the code I was writing although I am sure it is completely off because I am quite new to this stuff! Any help would be greatly appreciated!
Quote$dbhost="localhost";
$dbuser="****";
$dbpass="***";
$dbname1="publications_db";
$dbname2="activity_db";
$db1=mssql_connect($dbhost,$dbuser,$dbpass);
mssql_select_db($dbname1,$db1);
mssql_select_db($dbname2,$db1);
$query="SELECT * FROM publications_db P, activity_db A WHERE $_SESSION['SESS_MEMBER_ID'] = A.member_id AND A.pub_id = P.pub_id;";
echo "<table border cellpadding=2>";
while($info = mysql_fetch_array( $query ))
{
echo "<tr>";
echo "<th>ID:</th><td>".$info['pub_id'] . "</td> ";
echo "<th>Title:</th> <td>".$info['title'] . " </td>";
echo "<th>Author:</th> <td>".$info['author'] . " </td>";
echo "<th>Year:</th> <td>".$info['yr'] . " </td>";
echo "<th>Journal:</th> <td>".$info['journal'] . " </td>";
echo "<th>Pages:</th> <td>".$info['num_pages'] . " </td></tr>";
}
echo "</table>
";
echo "$count_entry Total Entries";
?>
Change snippet to use CURDATE
I am using time() in the snippet below, I would like to use CURDATE() and have the database setup for date. My problem is, I am not sure how to change the PHP coding, I keep getting errors just adding
need help in update query
hi i have a dynamic form. i need help in how can i use update query when values from dynamic form get pass to php file.currently when i press submit it displays this and does not update fieldsCode:
How many users online in the last 24-hours using time()?
I'm fairly new to PHP. I have a MySQL table called 'users' and a field called 'loggedin' which is in time() format.I need a query that'll check how many players have logged in within the last
Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
printing links
Hi every1i am connecting to a table in sql and the looping through with a while ($ var = my sql fetch array)the question i have is that when i print_r($var)i get the associative array of all elements
Need Reporting Advice
My SQL server doesn't support MS SQL reporting services that comes with SQL Enterprise or Express. Then the administrator suggested that I google for alternatives. I'm a newbie and don't even know
Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag that will disable the html between it for example:<a
PHP and XML image gallery variable issue
I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a variable called $current. I know that the code to display large image works, because it works when no
Memory Allocation
Hi folks,see this ex:int v=5;v=v+10;then what will do the compiler before the output come as 15.Please explain me technically.
is_dir() problem
Hello,I'm buidling a php scripts that dynamically get's subfolders from a specific folder.my code:Code: <?php if(isset($button)){ $opendirdepot =