mysql - php mysqli_fetch_array returning $name result as 'name' -


this question has answer here:

well first off, sorry if duplicate topic. did couldn't find anything.

here code:

<div id="box">         <?php             $query = mysqli_query($connection, "select 'id', 'name', 'url' uploads");             if(!$query)                 echo("connection error: " . mysqli_connect_error());             else             {                 while($run = mysqli_fetch_array($query))                 {                     $videoid = $run['id'];                     $videoname = $run['name'];                     $videourl = $run['url'];                 ?>                 <a href='http://seann.me.uk/streamy/view.php?video=<?php echo $videourl; ?>'>                 <div id="url">                     <?php echo $videoname; ?>                 </div>                 <?php                 }             }         ?>     </div> 

$videoname keeps coming "name" , $videourl comes http://seann.me.uk/streamy/view.php?video= have 2 videos in database @ moment have different names , id's. appreciated, reading.

remove quotes in select, using them selecting value (string literal) 'name' not field contents

 $query = mysqli_query($connection, "select id, name, url uploads"); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -