Jump to content

mcfc4heatons

New Members
  • Posts

    7
  • Joined

  • Last visited

mcfc4heatons's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a project on localhost with some dynamic data from MYSQL being echoed to page and it UTF-8 content including symbols like '£' are outputted correctly. When I upload to remote, I get '?' placeholders instead of some symbols, evidently not outputting as UTF-8. DB on remote is UTF-8, PHP file is UTF-8 format, UTF-8 is the default PHP encoding on remote. I just can't understand why not outputting UTF-8 correctly on remote?
  2. hi, How does one one write multiple conditional WHERE clauses where any values that are null are not part of the query Like this but where each one is only part of the where clause if the value is not null SELECT * FROM table WHERE col1 = ? AND col2 = ? AND col3 = ? AND col4 = ?
  3. OK, I worked it out: INSERT Into table2 (related_id) SELECT id FROM table1 WHERE id NOT IN (SELECT related_id FROM table2)
  4. this returns all the the records from table1 that are not in table2, just not sure how to combine an insert of the missing records into table2 ? SELECT id FROM table1 WHERE id NOT IN (SELECT related_id FROM table2)
  5. Hello, What's the correct way to compare two tables and update table 2 with any missing IDs? Scenario: Table 1 with primary key 'id' Table 2 with foreign key column 'related_id' linked to Table 1 'id' column Compare the two tables and insert any missing IDs into table 2 foreign_key 'related_id' column
  6. Hi - I’m getting an error all of a sudden, can somebody point me to the issue please? Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-1%’’ LIMIT 18446744073709551615’ at line 1 // begin Recordset $suggestParam__colours = '-1'; if (isset($_GET['suggest1_choice'])) { $suggestParam__colours = $_GET['suggest1_choice']; } $query_colours = sprintf("SELECT colour_name FROM colours WHERE colour_name LIKE '%s'", GetSQLValueString($suggestParam__colours . "%", "text")); $colours = $autocomplete->SelectLimit($query_colours) or die($autocomplete->ErrorMsg()); $totalRows_colours = $colours->RecordCount(); // end Recordset
  7. Hi, I want to create a function that reads the exif orientation data of an image and rotates it as required - needs to run before before the resize function here, I'm using GD library if that is relevant: function resize_gd($sourceFileName, $folder, $destinationFileName, $newWidth, $newHeight, $keepProportion) { $newWidth = (int)$newWidth; $newHeight = (int)$newHeight; if (!$this->gdInfo >= 1 || !$this->checkGdFileType($sourceFileName)) { return false; } $img = &$this->getImg($sourceFileName); if ($this->hasError()) { return false; } $srcWidth = ImageSX($img); $srcHeight = ImageSY($img); if ( $keepProportion && ($newWidth != 0 && $srcWidth<$newWidth) && ($newHeight!=0 && $srcHeight<$newHeight) ) { if ($sourceFileName != $folder . $destinationFileName) { @copy($sourceFileName, $folder . $destinationFileName); } return true; } if ($keepProportion == true) { if ($newWidth != 0 && $newHeight != 0) { $ratioWidth = $srcWidth/$newWidth; $ratioHeight = $srcHeight/$newHeight; if ($ratioWidth < $ratioHeight) { $destWidth = $srcWidth/$ratioHeight; $destHeight = $newHeight; } else { $destWidth = $newWidth; $destHeight = $srcHeight/$ratioWidth; } } else { if ($newWidth != 0) { $ratioWidth = $srcWidth/$newWidth; $destWidth = $newWidth; $destHeight = $srcHeight/$ratioWidth; } else if ($newHeight != 0) { $ratioHeight = $srcHeight/$newHeight; $destHeight = $newHeight; $destWidth = $srcWidth/$ratioHeight; } else { $destWidth = $srcWidth; $destHeight = $srcHeight; } } } else { $destWidth = $newWidth; $destHeight = $newHeight; } $destWidth = round($destWidth); $destHeight = round($destHeight); if ($destWidth < 1) $destWidth = 1; if ($destHeight < 1) $destHeight = 1; $destImage = &$this->getImageCreate($destWidth, $destHeight);
×
×
  • 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.