Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Column_1 Column_2
- 1 value1
- 2 value1
- 3 value2
- $query = "SELECT * FROM `table` WHERE `Column_1` = 'value1' ";
- print_r($query);
- echo count($query);
- $query = "SELECT * FROM `table` WHERE `Column_2` = 'value1' ";
- $res = mysql_query($query);
- if(mysql_num_rows($res)!=0) {
- while($rowData = mysql_fetch_array($res)) {
- var_dump($rowData);
- }
- }
- $query = "SELECT * FROM `table` WHERE `Column_1` = 'value1' ";
- $res = mysql_query($query);
- while($row = mysql_fetch_assoc())
- print_r($row);
- Use mysql_fetch_array() function
- $query = "SELECT * FROM `table` WHERE `Column_1` = 'value1' ";
- $res = mysql_query($query);
- while($row = mysql_fetch_array($res))
- {
- echo $row['Column_1'];
- echo $row['value_1'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement