Hi,
ich habe folgendes Problem.
Ich habe eine Anwendung geschrieben, die Werte aus einer Datenbank abliest
und sie nach der ID auflistet. Diesen Vorgang habe ich automatisiert.
Mit Hilfe eines Buttons, wird die Anfangs ID um 10 erhöht.
Es klappt auch alles wunderbar.
Doch wenn ich wieder auf die Urspungsdatei zugreife
Also anstatt "test.php?start=21&forward=Weiter" wieder auf "test.php"
Dann kommt bei mir folgende Meldung
"Notice: Undefined index: start in /app/www/test/a.php on line 18
Notice: Undefined index: start in /app/www/test/a.php on line 18
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"
hier ist der Code:
Alles anzeigen
Ich kann es mir nicht wirklich erklären, weil ich die Syntax bereits geprüft habe
und vorher lief ja auch alles.
Ich würde ich sehr über Hilfe freuen.
mfg,
PHPSprutz
ich habe folgendes Problem.
Ich habe eine Anwendung geschrieben, die Werte aus einer Datenbank abliest
und sie nach der ID auflistet. Diesen Vorgang habe ich automatisiert.
Mit Hilfe eines Buttons, wird die Anfangs ID um 10 erhöht.
Es klappt auch alles wunderbar.
Doch wenn ich wieder auf die Urspungsdatei zugreife
Also anstatt "test.php?start=21&forward=Weiter" wieder auf "test.php"
Dann kommt bei mir folgende Meldung
"Notice: Undefined index: start in /app/www/test/a.php on line 18
Notice: Undefined index: start in /app/www/test/a.php on line 18
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"
hier ist der Code:
Quellcode
- <?php
- error_reporting(E_ALL);
- include 'config.php';
- $db_link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
- mysql_select_db(MYSQL_DATABASE);
- if(isset($_GET['start'])) {
- $start = $_GET['start'];
- } else {
- $start = 1;
- }
- for($i=$_GET['start']; $i<$_GET['start']+10; $i++) {
- $sql = 'SELECT concat(`A`,0x203a20,`B`) FROM `table` where id = '.$i;
- $result = mysql_query($sql) OR die(mysql_error());
- $actual_result = mysql_result($result, 0);
- echo $actual_result;
- echo "<br>";
- }
- mysql_close($db_link);
- echo '<form method="get" action="">';
- echo '<input type="hidden" name="start" value="'.($start+10).'" />';
- echo '<input type="Submit" name="forward" value=">>>">';
- echo '</form>';
- ?>
Ich kann es mir nicht wirklich erklären, weil ich die Syntax bereits geprüft habe
und vorher lief ja auch alles.
Ich würde ich sehr über Hilfe freuen.
mfg,
PHPSprutz