hoe vraag ik een hele column op?
Damiaan
21/12/2008 02:01:00ik wil zeg maar als iemand registreert dat hij persoonlijke informatie krijgt
maar die moet natuurlijk ook opvraagbaar zijn, bev: naam posts clicks punten etc...
hoe vraag je die informatie op? tot nu toe heb ik dit maar daarmee vraag je de eerst row op....
=================
heb het opgelost dit is wat ik wou....
maar die moet natuurlijk ook opvraagbaar zijn, bev: naam posts clicks punten etc...
hoe vraag je die informatie op? tot nu toe heb ik dit maar daarmee vraag je de eerst row op....
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?php
// Make a MySQL Connection
$query = "SELECT * FROM users";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['name']. " - ". $row['age'];
?>
// Make a MySQL Connection
$query = "SELECT * FROM users";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['name']. " - ". $row['age'];
?>
=================
heb het opgelost dit is wat ik wou....
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
//connect
// Get a specific result from the "example" table
$result = mysql_query("SELECT * FROM users
WHERE username='damiaan'") or die(mysql_error());
// get the first (and hopefully only) entry from the result
$row = mysql_fetch_array( $result );
// Print out the contents of each row into a table
echo "</br><b>Points: </b></br>".$row['points'];
echo "</br> <b> Posts: </b></br>".$row['posts'];
?>
//connect
// Get a specific result from the "example" table
$result = mysql_query("SELECT * FROM users
WHERE username='damiaan'") or die(mysql_error());
// get the first (and hopefully only) entry from the result
$row = mysql_fetch_array( $result );
// Print out the contents of each row into a table
echo "</br><b>Points: </b></br>".$row['points'];
echo "</br> <b> Posts: </b></br>".$row['posts'];
?>
Gewijzigd op 01/01/1970 01:00:00 door Damiaan
PHP hulp
04/05/2024 11:49:38Wouter van Verre
21/12/2008 03:59:00Wat wil je precies doen??
Een column, bijv name, voor één gebruiker opvragen?
Of één column voor alle gebruikers opvragen?
Een column, bijv name, voor één gebruiker opvragen?
Of één column voor alle gebruikers opvragen?