afkappingsteken uit database halen
Maar hij geeft voortdurend een fout aan. kan dit opgelost worden. Zie hieronder mijn code
Code (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php session_start();
include("inc_logged_in.php");
include ("inc_connect.php");//include settings file
$field = $_GET["live"];
$id = $_SESSION["reqid"];
$field = mysql_real_escape_string($field);
$html = '' ;
$html .= '<select name="developer" id="developer" onchange="assigntodeveloper();">' ;
$html .= '<option value="0">- - Select developer - -</option>';
if(substr($field, 0,1) == "*")
{
$field = substr($field, 1,strlen($field)-1);
$result = mysql_query("SELECT * FROM users WHERE use_surname LIKE \"%$field%\" OR use_firstname LIKE \"%$field%\" ORDER BY use_surname ASC ") or die (mysql_error());
}
else $result = mysql_query("SELECT * FROM users WHERE use_surname LIKE \"$field%\" OR use_firstname LIKE \"$field%\" ORDER BY use_surname ASC ") or die (mysql_error());
$query = mysql_query("SELECT * FROM requirements WHERE req_id='$id'") or die (mysql_error());
$rowass= mysql_fetch_array($query) ;
if($_SESSION['editcon'] == "true")
{
//een lus om de gamma's in een listbox te stoppen
while($rowassto = mysql_fetch_array($result))
{ $surname=mysql_real_escape_string($rowassto['use_surname']);
$firstname = mysql_real_escape_string($rowassto['use_firstname']);
if($_SESSION['assigned2'] == $rowassto['use_id'])
{
$html .= "<option selected=\"selected\" name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
else
{
$html .= "<option name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
}
}
else
{
//een lus om de gamma's in een listbox te stoppen
while($rowassto = mysql_fetch_array($result))
{
if($rowass['use_id_assigned'] == $rowassto['use_id'])
{
$html .= "<option selected=\"selected\" name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
else
{
$html .= "<option name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
}
}
$html .= "</select>" ;
?>
html=document.getElementById('assignto');
html.innerHTML='<?php echo($html); ?>';
include("inc_logged_in.php");
include ("inc_connect.php");//include settings file
$field = $_GET["live"];
$id = $_SESSION["reqid"];
$field = mysql_real_escape_string($field);
$html = '' ;
$html .= '<select name="developer" id="developer" onchange="assigntodeveloper();">' ;
$html .= '<option value="0">- - Select developer - -</option>';
if(substr($field, 0,1) == "*")
{
$field = substr($field, 1,strlen($field)-1);
$result = mysql_query("SELECT * FROM users WHERE use_surname LIKE \"%$field%\" OR use_firstname LIKE \"%$field%\" ORDER BY use_surname ASC ") or die (mysql_error());
}
else $result = mysql_query("SELECT * FROM users WHERE use_surname LIKE \"$field%\" OR use_firstname LIKE \"$field%\" ORDER BY use_surname ASC ") or die (mysql_error());
$query = mysql_query("SELECT * FROM requirements WHERE req_id='$id'") or die (mysql_error());
$rowass= mysql_fetch_array($query) ;
if($_SESSION['editcon'] == "true")
{
//een lus om de gamma's in een listbox te stoppen
while($rowassto = mysql_fetch_array($result))
{ $surname=mysql_real_escape_string($rowassto['use_surname']);
$firstname = mysql_real_escape_string($rowassto['use_firstname']);
if($_SESSION['assigned2'] == $rowassto['use_id'])
{
$html .= "<option selected=\"selected\" name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
else
{
$html .= "<option name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
}
}
else
{
//een lus om de gamma's in een listbox te stoppen
while($rowassto = mysql_fetch_array($result))
{
if($rowass['use_id_assigned'] == $rowassto['use_id'])
{
$html .= "<option selected=\"selected\" name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
else
{
$html .= "<option name=\"asstp\" value=\"{$rowassto[use_id]}\">{$surname}{$firstname}</option>" ;
}
}
}
$html .= "</select>" ;
?>
html=document.getElementById('assignto');
html.innerHTML='<?php echo($html); ?>';
jasper schreef op 10.06.2009 23:23:
Maar hij geeft voortdurend een fout aan.
En welke is dat?
Hij zegt dat er een ; ontbreekt
Geef de volledige fout zoals jij die krijgt s.v.p....
Zou je niet gewoon enkele quotes (') gebruiken in je queries?
Zou je misschien de fout hier willen posten die vermeld word?
Tim Kampherbeek schreef op 11.06.2009 03:46:
Zou je misschien de fout hier willen posten die vermeld word?
Zo irritant als iemand herhaalt wat jij al zegt:
Karl schreef op 11.06.2009 00:30:
Geef de volledige fout zoals jij die krijgt s.v.p....