bmd91
Forum Replies Created
-
Forum: Hacks
In reply to: Admin-ajax returns a 0Make sure action and function are not called the same thing
Forum: Plugins
In reply to: AJAX returning 0Make sure ajax action matches first param of add_action in functions.php. And second param matches function name, but call both params different names. And I had to direct back an additional folder to admin-ajax
Resolved. I have two installs of wp-admin for some reason. Weird… thanks anyway
Not that I am aware of
That doesn’t work at all. Says ‘unexpected token return’ line 10, which is the ‘function your_ajax_callback(return){‘ line
Still doesn’t work. Any other suggestions?
Forum: Hacks
In reply to: Admin-ajax returns a 0found a work around
Forum: Plugins
In reply to: AJAX returning 0Also, the js function is being called on pageload:
$(document).ready(function(){ $("#trading_card_amount").keyup(populateCardAmount); });Forum: Fixing WordPress
In reply to: Simple MySQL QueryI looked back at where I was calling getCompanyData and saw I was calling a string. I set a variable equal to the string and then called the variable. Works now. Oops sorry
Forum: Fixing WordPress
In reply to: Simple MySQL QueryIt’s still direct insertion into the sql statement that is not working. Right now I have:
function getCompanyData($company){ $qry = "SELECT * FROM wp_companies WHERE 1=1 AND company_name = '$company' "; $data = mysql_query($qry); while($r = mysql_fetch_array($data,MYSQL_ASSOC)) { echo "<p>NAME:{$r['company_name']}</p>"; } }It is echoing out an empty array. Sorry for the confusion
Forum: Fixing WordPress
In reply to: Simple MySQL QueryI had
function getCompanyData($company){ $qry = "SELECT * FROM wp_companies WHERE 1=1 AND company_name = '$company' "; $data = mysql_query($qry); $r[]=mysql_fetch_array($data,MYSQL_ASSOC);to start
Forum: Fixing WordPress
In reply to: Simple MySQL QueryHaha I started this topic because that wasn’t working..remember?
Forum: Fixing WordPress
In reply to: Simple MySQL QueryOk so I have all the results by doing:
function getCompanyData($company){ $qry = "SELECT * FROM wp_companies WHERE 1=1"; $data = mysql_query($qry); while($r[]=mysql_fetch_array($data,MYSQL_ASSOC)){ for ($i=0; $i < count($r); $i++) { $name=$r[$i]['company_name']; } echo 'Name:'.$name.'<br />'; }; }But how would I be able to call getCompanyData(‘Acme’) and get only their data?
Forum: Fixing WordPress
In reply to: Simple MySQL QueryWell if I do that it retrieves all the rows. Why would the whole query work in phpmyadmin though? Also, I get :
Array ( [0] => Array ( [0] => 2 [ID] => 2 [1] => 1-800 Pet Supplies [company_name] => 1-800 Pet Supplies [2] => 0 [inventory] => 0 [3] => 0 [worth] => 0 [4] => http://www.google.com [value_check_url] => http://www.google.com )How do I get the 0,1,2,3,4 values out so it’s just id,co name, inventory, etc.?
Forum: Fixing WordPress
In reply to: Simple MySQL QueryEmpty with or without tags