View Single Post
  #7  
Old 12-18-2008, 08:44 AM
 
AMMoyer AMMoyer is offline
 

Senior Member
  
Join Date: Nov 2008
Posts: 150
 

Default Re: Data passing between template and PHP file

After implementing some of the suggestions and a couple of easy things I found this is what is happening.

php file
Code:
<?php $year = $_POST['year2']; ///////////////////////////////////////////////// make query for dropdown $query = sprintf("SELECT DISTINCT makeid, makename FROM iemmy WHERE yearid='$year'"); $result = @mysql_query($query); $rowMake = mysql_fetch_array($result); ///////////////////////////////////////////////// if (mysql_num_rows ($result) >= 1) { $makeid = array(); while ($rows = mysql_fetch_array ($result, MYSQL_ASSOC)) array_push ($makeid, $rows); $smarty->assign ("makeid", $makeid); } ?>

Is giving me:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\wamp\www\xcart\mmy.php on line 6

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\wamp\www\xcart\mmy.php on line 8

Now I'm guessing query is not returning any results. Does the query automatically use the last connection to the database? Or is there something I need to change in the connection to get this to work? Thanks again.

Adam
__________________
Adam
X-Cart Gold 4.4.5 - Live
X-Cart Gold 4.1.11 - Retired
X-Payments 1.0.4
CDSEO Pro
EWD Hosting
Reply With Quote