|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
query / sort by problem, Absolut Engine
Sorry to dump this on people but...(there is always a butt, isnt there)
I have installed and running the php news posting script Absolut Engine. I am trying to complete a modification that was reccomended in the scripts documentation. The modifiaction is displaying the archive by category. The directions from the readme qouted here quote: -------------------------------------------------------------------------------- For testing a successful query to or from database etc. use variable $outcome ONLY. part of example script: @$outcome=mysql_query("DELETE FROM table WHERE column='$column'"); require("failure.php"); /* call failure.php to test successful operation */ There are 4 files for use in public pages. You should copy&paste the PHP code enclosed in <? ?> brackets to your website pages. Brief descriptions of files: showarchive.php - displays the archive of all articles To display only the articles from one section change this line: @$outcome=mysql_query("SELECT * FROM articles WHERE adate<='$date' ORDER BY adate DESC"); to make it looks like this: @$outcome=mysql_query("SELECT * FROM articles WHERE section='$sectionid' adate<='$date' AND section='$sectionid' ORDER BY adate DESC"); $sectionid is the number shown before the section name in Section manager showarticle.php?id=$id - displays the article number ID showsurvey.php?id=$id - displays the survey number ID, if undefined current survey is displayed addcomment.php - adds comment to an article -------------------------------------------------------------------------------- and here is the script that I am trying to modify. quote: -------------------------------------------------------------------------------- <? $tempdir="admin/"; require("admin/connect.php"); $date=date("Y-m-d"); $pathimages=substr($pathimages,3,999); $i=0; $articlenumber=5; @$outcome=mysql_query("SELECT * FROM articles WHERE adate<='$date' ORDER BY adate DESC"); require("admin/failure.php"); while ($i<$articlenumber AND $access=mysql_fetch_array($outcome)) { ++$i; $id=$access["ID"]; $year=strval(substr($access["adate"],0,4)); $month=strval(substr($access["adate"],5,2)); $day=strval(substr($access["adate"],8,2)); $access["adate"]="$day.$month.$year"; $imageset=$access["imageset"]; $outcome2=$outcome; if ($imageset<>0) { @$outcome=mysql_query("SELECT * FROM images WHERE ID='$imageset'"); require("admin/failure.php"); while ($access2=mysql_fetch_array($outcome)) { $file1=$access2["file1"]; $thumb1=substr($file1,0,-4)."a".substr($file1,-4,4); } } $outcome=$outcome2; echo "</td></tr><tr><td><font face="Arial, Helvetica, sans-serif" size="2"><a href="showarticle.php?id=$id">".$access["title"]."</a></font><br>"; echo "<font face="Arial, Helvetica, sans-serif" size="1">".$access["adate"]." | <b>".$access["author"]."</b></font><br>"; if ($file1) echo "<a href="showarticle.php?id=$id"><img src="$pathimages$thumb1" border="0" align="left"></a>n"; echo "<font face="Arial, Helvetica, sans-serif" size="2">".$access["beginning"]."</font>"; $file1=""; $thumb1=""; } ?> -------------------------------------------------------------------------------- I have tried changing the reccomended section, with no luck. I even contacted the author of the script for a little help, the following quote is the result of the readme's, talking with the author and hours of head baning frustration. I am trying to display all the articles from section 1, and the below suggestion (according to the author) should work, but it doesnt. quote: -------------------------------------------------------------------------------- @$outcome=mysql_query("SELECT * FROM articles WHERE section='1' adate<='$date' AND section='$sectionid' ORDER BY adate DESC"); I am pretty sure I need to make a addition or change somewhere else in the script, but whatever I try doesnt work. A little or a lot of help would be helpful. Thanks |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > query / sort by problem, Absolut Engine |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|