Profile card

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
HankRock
 
 
Posts: 6
Joined: Tue Jan 22, 2019 9:05 pm

Profile card

Post by HankRock »

I've been working on creating a way to do a type of profile card for each person who signs up and have come up with the following:

<?php
$servername = "test.com";
$username = "username";
$password = "password";
$dbname = "users";
$conn = mysqli_connect($servername, $username, $password, $dbname) or die("Connection failed: " . mysqli_connect_error());
$sql = "SELECT avatar, fullname, extra7, extra1, extra2, extra3, extra4, extra8, extra9 FROM data WHERE extra8<>'Guest' and active='1'";
$resultset = mysqli_query($conn, $sql) or die("database error:". mysqli_error($conn));
while( $record = mysqli_fetch_assoc($resultset) ) {
define('IMAGE_DIR','avatars/');
?>
<center>
<br>
<div class="card hovercard">
<div class="cardheader">
<div class="avatar">
<img alt="No Image Available" src="<?php echo IMAGE_DIR . $record[avatar]; ?> "height="100px" width="100px" >
</div>
</div>
<div class="card-body info">
<div class="title">
<div class="desc"><?php echo $record['fullname']; ?></div>
<div class="desc">Cell- <?php echo $record['extra7']; ?></div>
<div class="desc"><?php echo $record['extra1']; ?></div>
<div class="desc"><?php echo $record['extra2']; ?>, <?php echo $record['extra3']; ?>, <?php echo $record['extra4']; ?></div>
<div class="desc"><?php echo $record['extra9']; ?></div>
<br>
</div>
</div>
<?php } ?>

It works great, creating what basically is a list showing the records... I'd like to get it into 2 columns, but have been unable to figure out how.

Any suggestions?
Post Reply