0 / 0 / 0
Регистрация: 23.11.2012
Сообщений: 14
1

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 '' at line 1

13.12.2012, 11:21. Показов 5173. Ответов 3
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
При написании обработчика данных формы ввода,произошла проблема с MySQL,браузер показывает такое сообщение : 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 '' at line 1.
Вот мой код
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<META http-equiv=Content-Language content=uk>
<META content="Microsoft FrontPage 6.0" name=GENERATOR>
 
</head>
<body>
<div id='Wrapper'>
 
<div id='Header'>
 
</div>
 
<div id='Container'>
<div id='Content'>
 
<?php 
@mysql_connect('localhost','php_admin','123') or die('Не могу подключиться к БД '.mysql_error());
mysql_select_db('test') or die(mysql_error());
//mysql_select_db('test');
 
mysql_query ("set character_set_client='cp1251'"); 
mysql_query ("set character_set_results='cp1251'"); 
mysql_query ("set collation_connection='cp1251_general_ci'"); 
 
 
?>
<?php
$select=mysql_query("SELECT * FROM news WHERE Id = {$id}") or die(mysql_error());
 
$fSelect=mysql_fetch_assoc($select);
echo "<h2>".$fSelect['Title']."</h2><div style='border:1px solid #777;'>".$fSelect['Text']."</div>";
 
?>
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
13.12.2012, 11:21
Ответы с готовыми решениями:

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 '111.bdbd12 b' a
Всем привет, ребята у меня странная ошибка с БД короче.. Создаю таблицу все норм. создается а вот...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the r
Доброго времени суток всем. Вознакила ошибка &quot;You have an error in your SQL syntax; check the...

Ошибка: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
Здравствуйте, php, mysql начала изучать совсем недавно, сегодня столкнулась с такой ошибкой: &quot;You...

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig
Помогите пожалуйста. Когда создаю таблицу: CREATE TABLE test(ID INT NOT NULL PRIMARY KEY...

3
18 / 18 / 4
Регистрация: 16.12.2012
Сообщений: 70
16.12.2012, 05:29 2
А чему равно $id в запросе?
0
0 / 0 / 0
Регистрация: 23.11.2012
Сообщений: 14
18.12.2012, 13:19  [ТС] 3
$id должен быть равен данным веденным с формы,от как это сделать?
0
18 / 18 / 4
Регистрация: 16.12.2012
Сообщений: 70
18.12.2012, 15:03 4
Читаем работа с формами
1
18.12.2012, 15:03
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
18.12.2012, 15:03
Помогаю со студенческими работами здесь

Ошибка SQL запроса #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax t
Помогите пожалуйста! CREATE TABLE `tickets` ( `id` int(4) NOT NULL auto_increment, `user`...

You have an error in your sql syntax check the manual that corresponds
Здравствуйте, у меня есть парсер на c# который заносит статьи в бд. private void insertData()...

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 '' at line 1
SQL - запрос : CREATE TABLE IF NOT EXISTS `data` ( `id` int(5) NOT NULL auto_increment, ...

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 '
чёто не робит &lt;?php include (&quot;db.php&quot;); session_start(); if (!empty($_SESSION) and...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
4
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2023, CyberForum.ru