Raaoul schreef:Ah oke, en als ik nu bij het hoogste "id" zijn rij een "naam" wil uithalen. Is dat dan ook zo?ORDER BY id DESC LIMIT 1Eerdere citaten tonen
Jordyvc schreef:Hoe kan ik bij PHP alleen het hoogste id uit de database halen? en laten echoen?
Kleine Vragen Topic #1
Wat bedoel je precies?
SELECT naam FROM lalala ORDER BY id DESC LIMIT 1 ?
Lennard schreef:Ah oke bedankt dat had ik nodigSELECT naam FROM lalala ORDER BY id DESC LIMIT 1 ?

Hoe doe ik dit?
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i1151.photobucket.com).Bron openen ↗
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i1151.photobucket.com).Bron openen ↗Thanks.
Wat is hier mis mee:
Deze error:
Quote:
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 Hoofd-DJ) at line 1
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]( ([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]) && ([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]signup[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$signup_sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO leden VALUES(,"[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$signup_sql[/COLOR] [COLOR= #007700]==[/COLOR] TRUE[COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Lid succesvol toegevoegd!"[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Error: Dit lid is niet succesvol aangemeld wegens: "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form method="POST" action="">
<table border="0" cellpadding="0" cellspacing="0" width="32%" id="table1">
<tr>
<td width="139">Naam</td>
<td>
<p><input type="text" name="username" size="26"></p>
</td>
</tr>
<tr>
<td width="139">Wachtwoord:</td>
<td><input type="text" name="password" size="26"></td>
</tr>
<tr>
<td width="139">Rang:</td>
<td><select name="rang">
<option>DJ</option>
<option>Hoofd-DJ</option>
<option>Support</option>
<option>Manager</option>
<option>Admin</option>
</select></td>
</tr>
<tr>
<td width="139"> </td>
<td><input type="submit" value="Verzenden" name="signup"></td>
</tr>
</table>
</form>"[/COLOR][COLOR= #007700];
}[/COLOR]
?> Deze error:
Quote:
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 Hoofd-DJ) at line 1
Je sluit de strin in de query niet af:
dat moet dus zo:
".sqlsafe($_POST[rang]).")" dat moet dus zo:
".sqlsafe($_POST[rang]).")" Werkt! Bedankt 

Wie weet een mooi lettertype ?
Mijn subdomain zijn SESSIONS werken gewoon niet 
http://panel.fakedmails.nl/
toevoeging op 4 juni 2012, 20:04:13:
toevoeging op 4 juni 2012, 20:04:30:
Wie vind de fout?

http://panel.fakedmails.nl/
toevoeging op 4 juni 2012, 20:04:13:
Maartenl schreef:VerdanaWie weet een mooi lettertype ?

toevoeging op 4 juni 2012, 20:04:30:
function login(username, password, length) {
var errors = new Array();
if(username == null || username == "") {
errors.push("Je moet wel een gebruikersnaam opgeven")
}
if((username != null && username != "") && username.length < 4) {
errors.push("Je gebruikersnaam is vast langer als 3 karakters")
}
if(password == null || password == "") {
errors.push("Je moet wel een wachtwoord opgeven")
}
if(errors.length != 0) {
} else {
alert(JAY);
}
} Wie vind de fout?

Stel voor ik heb een pagina vol met namen;
Henk
Peter
Jaap
Klaas
Ik wil dus op een andere pagina kijken of die naam er tussen staat en dat in een if statement.
Henk
Peter
Jaap
Klaas
Ik wil dus op een andere pagina kijken of die naam er tussen staat en dat in een if statement.
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]isNaam [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]Henk[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]naam is er[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]naam niet gevonden[/COLOR][COLOR= #007700];
}[/COLOR]
?> [COLOR= #0000BB]<?php
$namen[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Henk[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]Peter[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]Jaap[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]Klaas[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Henk[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$namen[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Naam is er[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Naam niet gevonden[/COLOR][COLOR= #007700];
}[/COLOR] Zo?
Maar dat werkt toch niet als ik op 2 verschillende paginas werkt.
namen.php en checknaam.php
namen.php en checknaam.php