Jump to content

KrisNz

Members
  • Posts

    271
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    Auckland, New Zealand

KrisNz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I have a query like this.. SELECT `franchiseid` FROM `franchise` WHERE CONCAT(',', `postcodes`, ',') LIKE '%,7895,%' LIMIT 1 which searches data like 1021,1024,7895 etc It mostly works, however, it doesn't match on the last item - in this case 7895. I can't see why it doesn't work when the concat puts the extra commas in I thought it would need to match. Can anyone suggest a fix or a better method? Thanks.
  2. $a will always equal 1 in your code, your login function never gets called. Maybe do a search for some login tutorials to help you along.
  3. You're missing a double quote. I'll let you find it
  4. Are you sure it's not just that query that's failing? table is a mysql keyword, try putting `table` instead. You should add some error handling to your query method also.
  5. What are all the loops for? If you print_r($arrayid) you get your desired output (more or less, you can sort() it if you want to get sequential keys).
  6. Try this... foreach ($object->Entries as $field_object) { echo $field_object->Field13.'<br/>'; } Obviously replacing $object with whatever variable you print_r'd.
  7. So, if I understand correctly, you let people run whatever php code they want on your server?
  8. The path you want to save to needs to include a file name, try if (ftp_get($resource, '/var/www/downloads/'.$files[$i], $files[$i], FTP_BINARY)){ Also recommend calculating the length of your for loop outside of the loop rather than in it. Or use foreach.
  9. In what way does it not work? Is $data['sec1'] empty or does it not unserialize into whatever it was when you serialized it?
  10. echo header("Content-type: application/xml"); $dom = new DOMDocument('1.0'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; $dom->loadXML($xmlobj->asXML()); echo $dom->saveXML(); exit;
  11. There's a few issues there, In the loop you reset $lastnameList on each iteration (that's why you only got the last result, however you don't need that loop at all) and array_push is only useful if you want to add more than 1 variable to an array as the function takes multiple arguments. Try this instead... $query = mysql_query('SELECT `lastname` FROM `names`') or trigger_error(mysql_error(),E_USER_ERROR) ; $lastnameslist = array(); while ($namesArray = mysql_fetch_assoc($query)) { $lastnameslist[] = $namesArray['lastname']; } print_r($lastnameslist);
  12. Is there any reason your array can't be structured like $['keyword'] = $timesAppearedOnPage; ??
  13. that would be mysql_data_seek() you're looking for. But in your query you use $ordersid but the variable you initialize at the start is $orderid. Are you sure that's working?
  14. What are you trying to do with this exactly?
  15. ahh ok, first of all, change your checkbox field names from winner to winners[] - this will allow multiple values to be posted back (i.e an array). You then need to loop through each value that was posted back and update it e.g foreach ($_POST['winners'] as $key => $teamId) { mysql_query("update picks set result = 'w' WHERE winner = '$teamId' AND result = 'o' ") or die(mysql_error()); }
×
×
  • 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.