Jump to content

Getting no data in Return With PHP MySQL


itsureboy

Recommended Posts

I have a php script to retrieve data from a table in a database.

However i get nothing in return.

Below are example of the table and my php.....

What am I doing wrong?

**There are no connection problems.**

Thanks in advance....

 

 

For example I have a table somewhat like this in my database.

 

color |||||| type  ||||

-------------------------

blue  |||||| shirt ||||

 

 

 

<?php

include 'dbconnect.php';

$query = mysql_query("SELECT type FROM mytable WHERE color = 'blue' ");
$row = mysql_fetch_assoc($query);


echo $row['type'];

?>

Link to comment
https://forums.phpfreaks.com/topic/40407-getting-no-data-in-return-with-php-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.