I worked on something quite similar recently. This will do exactly what you described. Of course you have to define exactly what you're replacing but if that is going to change you can put it into a $_POST variable
//read the text file, define what text you're replacing, GET or POST new text...
I have a page that categorizes information from a MySQL query
The ultimate result I'm trying to acheive is having a major category followed by a subcategory followed by the MySQL results, like this:
Environment (Major Category)
Agriculture (Sub category)
Results from query
Public Works (Major...
Getting very close, the only problem is the result it spits out is like this
Category 1 (Header)
cat 1 entry 1
Category 1 (Header)
cat 1 entry 2
Category 1 (Header)
cat 1 entry 3
Category 2 (Header)
cat 2 entry 1
Meaning that the header is repeated for each entry with a category = $category...
Whoops sorry I didn't specify the variables, they are mainly just pulling from MySQL
$program = $row['program'];
$description = $row['description'];
$funder = $row['funder'];
$duedate = $row['duedate'];
$nofa = $row['nofa'];
$guide = $row['guide'];
$application = $row['application']...
I have a small application that displays an HTML table in categories. The problem is I want a category header to be output each time the category changes. I have a numerical field in the database for the category.
I'm pretty dumb, so please be specific with any comments
i.e.
Category 1
cat1...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.