Jump to content

SELECT not working


The Little Guy

Recommended Posts

if your functions are unique say you want to do function eat an apple then don't pass its title but pass its functionID number in mysql across then you are always sure you get the right result.

A varchar compare has 100 more ways to fail than an integer to integer compare

Link to comment
https://forums.phpfreaks.com/topic/100005-select-not-working/#findComment-511421
Share on other sites

Is there more code than that cause you won't get much from just that just the resource id which doesn't mead much.

 

This will list field name and value

<?php
$sql = "SELECT * FROM `roster` WHERE sort = 1";
$res = mysql_query($sql) or die(mysql_error());
$r = mysql_fetch_assoc($res);
foreach($r as $key => $val){
echo "$key = $val<br />";
}
?>

 

Ray

Link to comment
https://forums.phpfreaks.com/topic/100005-select-not-working/#findComment-511427
Share on other sites

Well... The line above just includes the database connection information.

 

I don't want to pass an ID number, because the manual I am making has the same "Format" as PHP.net, where you just type in: http://sitename.com/random or http://sitename.com/abs and it will take you to that function.

 

I have never had this issue before...

Link to comment
https://forums.phpfreaks.com/topic/100005-select-not-working/#findComment-511443
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.