Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-16-2005, 05:09 PM Php info retrieval
Average Talker

Posts: 21
Trades: 0
OK, I'm trying to echo a list of people that are taking a class:

PHP Code:
<script language="javascript">
 function hunt_down_slot()

var a;
a=document.form1.class_selection.value;  //grabs value from dropdown menu
}
</script>
<?
$sql 
="
    SELECT * from classes_taken" 
;
    
$result4 mysql_query($sql);
    while (
$row mysql_fetch_array($result4)) {
      
$people_id=$row['people_id'];
    
$isittaken =$row['slot_1'];  //rather than '_1' I want '_a'
if ($isittaken == 1){
$sql ="
    SELECT * from people" 
;
    
$result5 mysql_query($sql);
    while (
$row2 mysql_fetch_array($result5)) {
      
$id=$row2['id'];
      
$first_name=$row2['first_name'];
      
$last_name=$row2['last_name'];
if (
$id == $people_id){echo $people_id " - " $last_name ", " $first_name "<br>";}}}}
?>
As you can see, I used "slot_1" instead of "slot_a" I can't seem to get the variable in there!

ARGH!

Thanks in advance

-Dave in IL

Last edited by sydcomebak; 06-16-2005 at 09:34 PM.. Reason: Posted attempt at end.
sydcomebak is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-16-2005, 07:11 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
You mean you want the name of the php variable to depend on the javascript? The javascript runs entirely clientside, so there's no way for php to know which drop down option was clicked unless you submit the whole form and regenerate the page.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 06-16-2005, 07:12 PM
Average Talker

Posts: 21
Trades: 0
OK, I want to do that then.

Or, I want it to open in a new frame or window.

Any suggestions?

-Dave in IL

Last edited by sydcomebak; 06-16-2005 at 07:17 PM..
sydcomebak is offline
Reply With Quote
View Public Profile
 
Old 06-17-2005, 11:22 AM
Average Talker

Posts: 21
Trades: 0
NM, I got it. Thanks for the reply.

http://www.wmaw2005.com/2005/reports/classlist.php

-Dave in IL
sydcomebak is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Php info retrieval
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21911 seconds with 12 queries