I ran across this a few minutes ago, and after some digging, found the solution, so I hope this helps someone else… What I was trying to do? Simple Ajax GET Where? From AND TO my local server Why? To learn! What error was I getting? Error: uncaught exception: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]" nsresult: [...]
function mysql_insert($table, $toAdd){ $fields = implode(array_keys($toAdd), ','); $values = "'".implode(array_values($toAdd), "','")."'"; # better $q = 'INSERT INTO `'.$table.'` ('.$fields.') VALUES ('.$values.')'; $res = mysql_query($q)OR die(mysql_error()); return true; //– Example of usage //$tToAdd = array('id'=>3, 'name'=>'Yo', 'salary' => 5000); //insertIntoDB('myTable', $tToAdd) } function mysql_update($table, $update, $where){ $fields = array_keys($update); $values = array_values($update); $i=0; $query="UPDATE ".$table." SET [...]
Ok, so I have been looking around for a good highligher and this will be where I keep track of what I find: SyntaxHighlighter is here to help a developer/coder to post code snippets online with ease and have it look pretty. It's 100% Java Script based and it doesn't care what you have on your server. [...]