GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Jun-2004, 15:55
misunderstood misunderstood is offline
Member
 
Join Date: Jun 2003
Posts: 121
misunderstood is on a distinguished road

php includes


I am using
PHP Code:

// query here
//
$carresult=mysql_query("SELECT * FROM $careers WHERE agent_id=$listingid");
// got result now count the rows HERE so its not repeated within loop!!
$carnumRows=mysql_num_rows($carresult);
//
 for($i=0;$i<$carnumRows;$i++){
    $carrow=mysql_fetch_assoc($carresult);
    
// display 
echo "<a href='view_career.php?listingid=".$carrow["id"]."' target='_self' title='".$carrow["title"]."' class='menufont'>".$carrow["title"]."</a>
";

} 


and then including it in a page.
PHP Code:

$listingid 


is in the main page. The result displays the rows correctly BUT only the first row links to the correct page. I cannot work out why this is happening in the page but it will work correctly if the include is viewed on its own. Am I missing something???????? (as usual)
  #2  
Old 25-Jun-2004, 19:50
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
How do you 'include' with just a variable? I am confused, that first PHP code example is your include file?

What's wrong with using require_once() or include_once() to include stuff in your main script?
  #3  
Old 26-Jun-2004, 07:47
misunderstood misunderstood is offline
Member
 
Join Date: Jun 2003
Posts: 121
misunderstood is on a distinguished road
Quote:
Originally Posted by JdS
How do you 'include' with just a variable? I am confused, that first PHP code example is your include file?

What's wrong with using require_once() or include_once() to include stuff in your main script?
Sorry if my explaination was confusing I just worded everything in gobbledy-gook
I have solved the problem now. The problem lay in the position within a div using css. For some reason, even when using plain html the links would not work correctly when a div was placed within another div. Strange but I solved the problem by moving the position of the include.
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
uisng php to display php dopee MySQL / PHP Forum 6 14-May-2004 19:40
php software dopee MySQL / PHP Forum 0 04-May-2004 12:26
Optimizing your web server with Turck MMCache for PHP JdS Web Hosting Forum 2 07-Jan-2004 08:48
[Linux] Installing PHP --with-mcrypt JdS Web Hosting Forum 0 20-Aug-2003 09:40
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 17:14

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:02.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.