Php hulp

Gestart doorJorzwa14 reacties125 weergaven

15 berichten · pagina 1 van 1

Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik wil graag ophalen wie het topic heeft gemaakt maar als ik het ophaal met dit:

[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL]  [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]]);[/COLOR] ?>


geeft die alleen user id

dus ik dacht zoiets:

[COLOR= #0000BB]<?php[/COLOR] SELECT username FROM users WHERE id[COLOR= #007700]=[/COLOR][COLOR= #DD0000]stripslashes($tFetch[[/COLOR]author[COLOR= #DD0000]])[/COLOR] ?>


Maar dat werkt ook niet wie kan me helpen?
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$get[/COLOR][COLOR= #007700]->[/COLOR]author[COLOR= #007700]);[/COLOR]
?>
0
Berichten
32
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]]);[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]

 ?>


Probeer zo eens biggrin
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dasaque schreef:
[COLOR= #0000BB]<?php
$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$get[/COLOR][COLOR= #007700]->[/COLOR]author[COLOR= #007700]);[/COLOR]
?>
Werkt niet geeft errors
Gamerod schreef:
[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]]);[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]

 ?>
Probeer zo eens biggrin
werkt niet geeft geen errors maar geeft hellemaal niks aan
0
Berichten
32
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jorzwa schreef:
Eerdere citaten tonen
Dasaque schreef:
[COLOR= #0000BB]<?php
$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$get[/COLOR][COLOR= #007700]->[/COLOR]author[COLOR= #007700]);[/COLOR]
?>
Werkt niet geeft errors
Gamerod schreef:
[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]]);[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]

 ?>
Probeer zo eens biggrin
werkt niet geeft geen errors maar geeft hellemaal niks aan

Er moet ook nog een echo onder,

[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$userget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userrow[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$userget[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$userrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]

 ?>
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gefixd!

[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$userget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userrow[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$userget[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$userrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]

 ?>


dan haal ik zo op wie de laatste bericht heeft gestuurd toch?
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet de query wel goed zetten .. geef is wat meer informatie

SELECT * FROM forum_topic ??? zo kan ik je nooit helpen.
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
SELECT * FROM topics is het
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #FF8000]/**
 * @author Script-Base
 * @copyright 2011
 */

// Overige shit.[/COLOR]
[COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM topics WHERE gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$get[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$get[/COLOR][COLOR= #007700]->[/COLOR][COLOR= #FF8000]//hier de table invullen die in de database staat.[/COLOR]

?>


Mag ik vragen welk systeem dit is of anders moet je meer informatie geven smile
0
Berichten
32
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als de poster en de laatste reactie in de database staan en de naam daarvan is topics dan kan je ze het best zo ophalen:

(hierin ga ik ervan uit dat elk topic een id heeft)

[COLOR= #0000BB]<?php

$topicget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM topics WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$topicrow[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$topicget[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$poster[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$topicrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$last[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$topicrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]];[/COLOR]


[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$poster[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$last[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gamerod schreef:
Als de poster en de laatste reactie in de database staan en de naam daarvan is topics dan kan je ze het best zo ophalen:

(hierin ga ik ervan uit dat elk topic een id heeft)
[COLOR= #0000BB]<?php

$topicget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM topics WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$topicrow[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$topicget[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$poster[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$topicrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]author[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$last[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$topicrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]];[/COLOR]


[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$poster[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$last[/COLOR][COLOR= #007700];[/COLOR]
?>


Werkt niet hij geeft errors aan en ja elk topic heeft een id er is een tabel voor forumreactions
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kom eens teamviewer? Post je gegevens even per PB.
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dasaque bedankt je hebt me met alles geholpen echt bedankt snap nu ook beetje hoe qeury werkt!
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jorzwa schreef:
Gefixd!
[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$userget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userrow[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$userget[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$userrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]

 ?>


dan haal ik zo op wie de laatste bericht heeft gestuurd toch?

[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$userget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userrow[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$userget[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$userrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]

 ?>
0
Jorzwa

Lid · Topicstarter

Berichten
1.644
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kyron schreef:
Eerdere citaten tonen
Jorzwa schreef:
Gefixd!
[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$userget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id=$id"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userrow[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$userget[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$userrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]

 ?>


dan haal ik zo op wie de laatste bericht heeft gestuurd toch?
[COLOR= #0000BB]<?php 
$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]last_reaction[/COLOR][COLOR= #007700]]);[/COLOR]

[COLOR= #0000BB]$userget[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT username FROM users WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$userrow[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$userget[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$userrow[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]

 ?>


werkt niet ik kom er net achter dat in last_reaction alleen datum staat
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren