Хорошо, это, наверное, что-то простое, что я пропускаю, но я так много раз продумал это!PHP + MySQL UPDATE-запрос (несколько столбцов) не работает
Простое обновление с помощью формы PHP, тянет в переменных, строит запрос:
// Connect
$connect = mysql_connect('host','login','passwd');
if (!$connect) { $errors .= "Not connected : ".mysql_error(); }
$database = mysql_select_db('db', $connect);
if (!$database) { $errors .= "Could not get to that database: ".mysql_error(); }
// Update database table
$info = "UPDATE `gsa_officers` SET `term` = '2012-2013', `office` = 'President', `type` = 'Poop', `dept` = 'Visual Arts', `name` = 'Matthew W. Jarvis', `email` = '[email protected]ucsd.edu', `blurb` = 'Serves as Chair of both the GSA Executive Committee and Council, oversees the direction of the organization and ensures the execution of its responsibilities and commitments.', `picture` = 'http://gsa.ucsd.edu/sites/gsa.ucsd.edu/files/mat%20w%20jarvis.jpg' WHERE `id` = 1";
$query = mysqli_query($info);
if (!$query) { $errors .= "Bad query: ".mysql_error(); }
mysql_close($connect);
я не получаю никаких ошибок, он только печатает: «Bad запрос:»
Что я отсутствующий/Неправильно? Любые дополнительные глазные яблоки оценены^_^
Lol, ок я идиот. У меня было все в одном направлении, это не сработало, поэтому я заменил его на mysqli_ *, и он все еще не работал, поэтому я вернул его обратно к оригиналу (или так я думал). Спасибо, это работает сейчас :) – Kaceykaso