Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8509825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:32:21+00:00 2026-06-11T03:32:21+00:00

Im trying to create this thing that if its get nothing from a array

  • 0

Im trying to create this thing that if its get nothing from a array it would bring up a default picture but its not working out the way i want it to. It using every array but i want to separate each away.

    $result = mysql_query("SELECT * FROM `im_album` WHERE username = '".$user_data['username']."'  ");
$d_name = array();
$d_amount = array();
$d_cover = array();
while(($row =  mysql_fetch_assoc($result))) {
    $d_name[] = $row['name'];

    $d_mode[] = $row['mode'];
    $d_amount[] = $row['amount'];
    $d_cover[]= $row['cover'];
 }
$p_cover = implode($d_cover) ;
  if ( $p_cover == "") {
  $p_cover = "cpages/img/default_pic.jpg";
  }
  else
  {
  $p_cover= "userdata/".$user_data['username']."/profilepic/".$p_cover;
  }
<img  style="margin:2pt" src="<?php echo $p_cover ?>"  height="250" width="200"  />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:32:23+00:00Added an answer on June 11, 2026 at 3:32 am
    $result = mysql_query("SELECT * FROM `im_album` WHERE username = '".$user_data['username']."'  ");
    while ($row =  mysql_fetch_assoc($result)) {
      $d_name = $row['name'];
      $d_mode = $row['mode'];
      $d_amount = $row['amount'];
      $d_cover = $row['cover'];
      if ( $d_cover == "") {
      $p_cover = "cpages/img/default_pic.jpg";
      }
      else
      {
      $p_cover= "userdata/".$user_data['username']."/profilepic/".$d_cover;
      }
      echo '<img  style="margin:2pt" src="'.$p_cover.'"  height="250" width="200"  />';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create something that works like this but doesn't have any submenus.
I am trying to create this QT gui using a thread but no luck.
I'm trying to create this effect: http://www.thecssninja.com/demo/css_tree/ the problem I'm having is that the
I'm trying to use this gem to create a honeypot field, but I'm not
I am trying to create a custom Dojo ValidationIdBox widget that inherits from ValidationTextBox.
Im Trying to create this: |---------------------------------------------| | Panel 1a | Panel 2a | Panel
I am trying to create this table in a MySQL database CREATE TABLE IF
I am trying to create this tooltip sample for my wordpress it works just
I am trying to create this simple application in c#: when the user double
I am trying to create something like this as i have done it in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.