Infamous cTz Posted June 18, 2010 Share Posted June 18, 2010 how would i go about making the pet image apear or a no pet image if theres none selected.... [mysql] <? if($user_class->pet != ""){ ?> <? } else { ?> <? } ?> [/mysql] i dont even think user_class->pet will pull your pet... i really appreciate all the help ive received on this site ... but lol again ahh help please ?( Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted June 18, 2010 Share Posted June 18, 2010 Select the image table from the db, If no image is there then output the default image, if not then show the real image if($row['image']){ $petimage= "[img=images/" . $row[]";} else{ $petimage= "[img=images/mynoimage.gif]"; } Something along those line's, You'd need to do the select query and change stuff though Quote Link to comment Share on other sites More sharing options...
Infamous cTz Posted June 18, 2010 Author Share Posted June 18, 2010 hmm its just displaying the no pet image... and when i tried switching them around i just got $petimage= "";} with no image hmm Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted June 18, 2010 Share Posted June 18, 2010 Is the db row empty? Quote Link to comment Share on other sites More sharing options...
Infamous cTz Posted June 18, 2010 Author Share Posted June 18, 2010 it stored in its own table called pets... within that is the userid with the pet owners id pets -userid Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted June 18, 2010 Share Posted June 18, 2010 Do a query selecting the information, the code I supplied will then print out the data for you Quote Link to comment Share on other sites More sharing options...
Infamous cTz Posted June 18, 2010 Author Share Posted June 18, 2010 also i would like links to refill loyalty and energy... but the links are all crazy mypets.php?refill_energy=Refill+Energy&pet_id=253 its all from a form and looks like [mysql]<form method=get action=$PHP_SELF> <input type=submit name=refill_energy value=\"Refill Energy\"><input type=hidden name=pet_id value=\"$line[id]\"></form> [/mysql] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.