开发者

Dropping a column from a "$result" resource after a db query

After a simple query that is successful,

$sql = "SELECT * FROM mytable" ;
$resu开发者_运维技巧lt = mysql_query ( $sql ) ;

is there a way to "drop" a specified column from the $result resource? IOW, the $result consisted previously of 8 fields, but afterwards contains of only 7.

Thanks.


What you could do is assign the values from your $result into an array, unset $result to clear up the memory (if it is a large result set), and then unset the specific sub array containing the column data no longer needed.


I think you can't do that after you have commited the query with specified columns. However you can specify this from your query statement as to which columns should be selected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜