[help] php marquee

Gestart doorDuwd27 reacties118 weergaven

28 berichten · pagina 1 van 2

Duwd

Lid · Topicstarter

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

ik ben bezig met een klein scriptje voor een berichten balk.
maar nu wil ik dus dat alle informatie uit de database achter elkaar beweegt maar nu heb ik dit
knip

het script

Codeblok (balk.php):

1
2
3
4
5
6
7

nieuw

echo "$naam - $bericht";
}

?>



weet iemand hoe ik dit moet oplossen?
mvg
0
Berichten
3.334
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Duwd schreef:
Hallo,

ik ben bezig met een klein scriptje voor een berichten balk.
maar nu wil ik dus dat alle informatie uit de database achter elkaar beweegt maar nu heb ik dit
http://mop.s2.one2xs.com/balk.php

het script

Codeblok (balk.php):
1
2
3
4
5
6
7

nieuw

echo "$naam - $bericht";
}

?>



weet iemand hoe ik dit moet oplossen?
mvg

Je zou met een while ze achterelkaar kunnen plakken.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SELECT * FROM berichten ORDER BY date DESC[/COLOR][COLOR= #007700]);[/COLOR]
?>
<marquee>
  <a href="#">nieuw</a> 
  [COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] | [/COLOR][COLOR= #007700];
  }[/COLOR]
  ?>
</marquee>
0
Duwd

Lid · Topicstarter

Berichten
36
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Xjessex schreef:
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SELECT * FROM berichten ORDER BY date DESC[/COLOR][COLOR= #007700]);[/COLOR]
?>
<marquee>
  <a href="#">nieuw</a> 
  [COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] | [/COLOR][COLOR= #007700];
  }[/COLOR]
  ?>
</marquee>
Als ik dat doe komt er helemaal niks?
0
Berichten
3.334
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Duwd schreef:
Eerdere citaten tonen
Xjessex schreef:
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SELECT * FROM berichten ORDER BY date DESC[/COLOR][COLOR= #007700]);[/COLOR]
?>
<marquee>
  <a href="#">nieuw</a> 
  [COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] | [/COLOR][COLOR= #007700];
  }[/COLOR]
  ?>
</marquee>
Als ik dat doe komt er helemaal niks?

Wel even de goede query hé.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Xjessex schreef:
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SELECT * FROM berichten ORDER BY date DESC[/COLOR][COLOR= #007700]);[/COLOR]
?>
<marquee>
  <a href="#">nieuw</a> 
  [COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] | [/COLOR][COLOR= #007700];
  }[/COLOR]
  ?>
</marquee>
mysqlibloosbloos
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Dylanh schreef:
Eerdere citaten tonen
Xjessex schreef:
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]SELECT * FROM berichten ORDER BY date DESC[/COLOR][COLOR= #007700]);[/COLOR]
?>
<marquee>
  <a href="#">nieuw</a> 
  [COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$message[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] | [/COLOR][COLOR= #007700];
  }[/COLOR]
  ?>
</marquee>
mysqlibloosbloos
Doe ik niet aan.
Ik programmeer sowieso niet meer in PHP wink
0
Duwd

Lid · Topicstarter

Berichten
36
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Spoiler tonen
Codeblok (balk.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>


dit is wat ik nu heb maar ik krijg niks
0
Berichten
3.334
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Duwd schreef:
Spoiler tonen
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>


dit is wat ik nu heb maar ik krijg niks

Bestaat de tabel laatste?
0
Duwd

Lid · Topicstarter

Berichten
36
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Robiin schreef:
Eerdere citaten tonen
Duwd schreef:
Spoiler tonen
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>


dit is wat ik nu heb maar ik krijg niks

Bestaat de tabel laatste?

jup
0
Berichten
3.334
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Duwd schreef:
Eerdere citaten tonen
Robiin schreef:
Eerdere citaten tonen
Duwd schreef:
Spoiler tonen
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>

dit is wat ik nu heb maar ik krijg niks

Bestaat de tabel laatste?

jup

Hoe zit de structuur in elkaar?
0
Duwd

Lid · Topicstarter

Berichten
36
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Robiin schreef:
Eerdere citaten tonen
Duwd schreef:
Eerdere citaten tonen
Robiin schreef:
Eerdere citaten tonen
Duwd schreef:
Spoiler tonen
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>

dit is wat ik nu heb maar ik krijg niks
Bestaat de tabel laatste?

jup

Hoe zit de structuur in elkaar?
Afbeelding
0
Berichten
3.334
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Duwd schreef:
Eerdere citaten tonen
Robiin schreef:
Eerdere citaten tonen
Duwd schreef:
Eerdere citaten tonen
Robiin schreef:
Eerdere citaten tonen
Duwd schreef:
Spoiler tonen
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>

dit is wat ik nu heb maar ik krijg niks
Bestaat de tabel laatste?
jup

Hoe zit de structuur in elkaar?

Afbeelding

Wat krijg je te zien?
0
Berichten
3.001
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Duwd schreef:
Spoiler tonen
Codeblok (balk.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>


dit is wat ik nu heb maar ik krijg niks

Je gebruikt MySQL en MySQLi door elkaar.
Doe dus óf je verbinding in MySQL of je querys in MySQLi
0
Berichten
3.334
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bugged schreef:
Eerdere citaten tonen
Duwd schreef:
Spoiler tonen
Codeblok (balk.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = mysql_query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = mysql_fetch_assoc($query) {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>


dit is wat ik nu heb maar ik krijg niks

Je gebruikt MySQL en MySQLi door elkaar.
Doe dus óf je verbinding in MySQL of je querys in MySQLi

Ochja, dat ik dat nou niet zag emo
toevoeging op 13 april 2014, 15:02:22:

Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$con
=mysqli_connect("localhost","***","***","***");

if (mysqli_connect_errno())
{

echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

?>

$query = $con->query("SELECT * FROM laatste ORDER BY id ASC");
?>

nieuw

while($message = $query->fetch_assoc() {
echo htmlentities($message[naam]). - .htmlentities($message[bericht]). | ;
}

?>
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