You are viewing our Forum Archives. To view or take place in current topics click here.
How would i make data from a database echo into a ..
Posted:

How would i make data from a database echo into a ..Posted:

blueninjn
  • Junior Member
Status: Offline
Joined: Dec 28, 201310Year Member
Posts: 85
Reputation Power: 3
Status: Offline
Joined: Dec 28, 201310Year Member
Posts: 85
Reputation Power: 3
how would i make it so that data echoed into a certain format for each record im really confused
#2. Posted:
Hacz
  • Summer 2018
Status: Offline
Joined: Mar 04, 201014Year Member
Posts: 2,891
Reputation Power: 150
Status: Offline
Joined: Mar 04, 201014Year Member
Posts: 2,891
Reputation Power: 150
What do you mean by in a certain format? Do you mean like put specific data into a row?

EDIT: Read OP wrong. User below answered the question to my knowledge.


Last edited by Hacz ; edited 2 times in total
#3. Posted:
MLP
  • TTG Contender
Status: Offline
Joined: Oct 26, 201014Year Member
Posts: 3,869
Reputation Power: 177
Status: Offline
Joined: Oct 26, 201014Year Member
Posts: 3,869
Reputation Power: 177
If you want to do this in PHP, this should be an adequate solution:

PHP

$mysqli = new mysqli("Hostname", "Username", "password", "database");

$query = "SELECT * FROM table_name WHERE someField='SomeValue'";
$result = $mysqli->query($query);

while($row = $mysqli->fetch_array($result)) {
  echo $row['anotherField'];
  echo "<br />";
}


This code (Should) print out each instance of the field "anotherField" where the value of "someField" is equal to "someValue".

I hope I haven't confused you with my naming conventions. If required, I can comment the code further to explain in more depth what everything does. I'm just assuming you have some PHP knowledge to understand what's going on.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.