Jump to content

keithschm

Members
  • Posts

    34
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

keithschm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you all very much. I struggled with the left join but once I got it working if fixed my issue. Thank you all very much for your help
  2. function getCache($address) { if(!isset($this->dsn)) return false; $_ret = array(); // PEAR DB require_once('DB.php'); $_db =& DB::connect($this->dsn); if (PEAR::isError($_db)) { die($_db->getMessage()); } $_res =& $_db->query("SELECT lon,lat FROM {$this->_db_cache_table} where address = ?", $address); if (PEAR::isError($_res)) { die($_res->getMessage()); } if($_row = $_res->fetchRow()) { $_ret['lon'] = $_row[0]; $_ret['lat'] = $_row[1]; } $_db->disconnect(); return !empty($_ret) ? $_ret : false; }
  3. yea include("config.php"); include("configopen.php"); mysql_close($conn); are part of the script just did not think I needed to post it
  4. mysql_query() sends an unique query (multiple queries are not supported) to the currently active database on the server that's associated with the specified link_identifier. so if multiple queries are not supporeted what would I use. I have script using php to read a database, that passes data to a function that uses the PEAR::DB module to read and write to a differnt table on the same database. If my php query respondes with more the 1 result I get Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' Warning: mysql_query(): A link to the server could not be established if I disable the pear part it works fine, if I disable the mysql_query() and feed it static info it works fine. they just will not work together. any suggestions? Thanks here is my query $query = "SELECT user_id, user_name FROM e107_user WHERE user_name like 'somedata%'"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $userid = $row['user_id']; $query2 = "SELECT user_location FROM e107_user_extended WHERE user_extended_id = $userid"; $result2 = mysql_query($query2); while($row2 = mysql_fetch_assoc($result2)) { $loc = $row2['user_location']; }
  5. thanks for all your help. Maybe someone can move this to the correct sub forum. I am sorry that I put it in the wrong forum I am using 2 different database's. one for the geocode caching another that has a user database from my cms. The class came scripted to read and write the cache from a databse. Pulling locations it does not. It looks for these lines in the main file.] map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>'); $map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>'); $map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>"); I haved added my own code to pull the info from the database that has the information in it. here is my code $query = "SELECT user_id, user_name FROM e107_user where user_name = 'john doe'"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $map2 = 'addMarkerByAddress('; $userid = $row['user_id']; $query2 = "SELECT user_location FROM e107_user_extended where user_extended_id = $userid"; $result2 = mysql_query($query2); while($row2 = mysql_fetch_assoc($result2)) { $loc = $row2['user_location']; $map2 .=$loc; } $name= $row['user_name']; //echo $name; //echo $row['user_name']; $map2 .= ','; $map2 .= $name; $map2.= ','; $map2 .= $name; $map2.= ') '; $map2 .= '<br />'; } $map->$map2; echo $map; mysql_query($query) or die('Error, insert query failed'); mysql_close($conn); The data is pulling correctly from the database. So how would I send the data to the class.
  6. thank you for your reply ok so the script has these lines of code $map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>'); $map->addMarkerByAddress('826 P St Lincoln NE 68502','Old Chicago','<b>Old Chicago</b>'); $map->addMarkerByAddress('3457 Holdrege St Lincoln NE 68502',"Valentino's","<b>Valentino's</b>"); what would be the best way to pull the info from the datbase? I have the information from my sql statements, and I am looping through the code to pull all if the info
  7. I am using a google API script to show a map with many points. I am pulling city and state and names from a mysql database. I can pull the info correctly, but can't seem to format the $var properly it should look like $map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>'); and I have these vars $loc $name I have tried $map2 = 'addMarkerByAddress('; $map2 .=$loc; $map2 .= ','; $map2 .= $name; $map2.= ','; $map2 .= $name; $map2.= ') '; $map->$map2; when I echo it it looks correct, but does not pas the var to the script properlly. I think I am formating it for viewing not sure. also what does -> mean in PHP thanks
  8. <SELECT NAME="Subject"> <OPTION SELECTED>List Item 1</OPTION> <OPTION>List Item 2</OPTION> <OPTION>List Item 3</OPTION> </SELECT>
  9. can you send me a link so I may see the page
  10. ok yes  you just have to construct  you where query then you if when you display them
  11. not the way you have your datbase setup.  you have 1 product 1 stock level    you need 1 product ---options---\ ----------------------options 1  ------stock level ----------------------options 2  ------stock level Oscommerece has these features built in and it is open source{free}
  12. just join the prod_size table in your query an then add  to your where stament and where stock_level < 0 something likek that should work
  13. In order to really help you could you please post site code, examples,  someting.  your question is so broad that it is very diffacult to answer. but if I understand what you mean you could create a page that queries the database for all blogs from october. if you need help with the query post some of your code.
  14. [quote author=HuggieBear link=topic=110697.msg448063#msg448063 date=1160149859] How are you propogating the array? Regards Huggie [/quote] what do you mean?
  15. WOW thank you all so much for your help. now this array seems very comlicated to me as it looks like arrays inside arrays [code] Array (     [0] => Array         (             [1DA] => 27.84         )     [1] => Array         (             [1DP] => 24.23         )     [2] => Array         (             [2DA] => 14.33         )     [3] => Array         (             [3DS] => 10.60         )     [4] => Array         (             [GND] => 6.65         ) ) [/code] it is the return values for ups quotes.  I need to alter it.  the text is the shipping type and the numbers is the cost.  I need to subtract the value associted with the GND  from all the other vales in the array I tried "for each" but I am lost any sugestion thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.