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.

JavaScript Forum


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



Reply
comparing php values and getting "value undefined"
Old 06-13-2005, 07:16 PM comparing php values and getting "value undefined"
Average Talker

Posts: 21
Trades: 0
Code:
<?

$sql ="
	SELECT * from disc_codes" ;
	$result4 = mysql_query($sql);
	while ($row = mysql_fetch_array($result4)) {
                $id=$row['id'];
	$vend =$row['vend'];
	}

?>
<?=vend?> displays the correct value when placed in the html: (abcde), however:

Code:
<script type="text/javascript">
 function calc_disc()
 {
if(<?=$vend?> == <?=$vend?>)
     {
    alert("Values Match")  
     } 
 }
 </script>
returns an error of:

Error: 'abcde' is undefined
Code: 0

Did I make a typo? Even so, I'd think that because I'm comparing the same 2 things, it'd work.

Last edited by sydcomebak; 06-13-2005 at 09:51 PM..
sydcomebak is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-13-2005, 07:59 PM
Average Talker

Posts: 21
Trades: 0
I was wrong, I haven't fixed it.

Any help is appreciated!

-Dave in IL

Last edited by sydcomebak; 06-13-2005 at 09:44 PM..
sydcomebak is offline
Reply With Quote
View Public Profile
 
Old 06-19-2005, 10:48 PM
Average Talker

Posts: 21
Trades: 0
Fixed
sydcomebak is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to comparing php values and getting "value undefined"
 

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.12936 seconds with 12 queries