I am wondering if there is a way to select part of a column in mysql. For example, I want to select all statistics from my table that end in "_sep_2012". This will give me access to 1_sep_2012, 2_sep_2012, 3_sep_2012, etc. Is there any way to do this?
<?php
$query=mysql_query("SELECT %_sep_2012% FROM statistics WHERE id = '$id'");
$array = mysql_fetch_row($query);
$monthly_total = $array[0];
echo "$monthly_total";
?>
Any help would be greatly appreciated. Thank!
source
share