Join 132,685 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,247 people online right now. Registration is fast and FREE... Join Now!
this whole code for browse page, but even though it said line 71, still couldnt find it, prob me just missing it, but any help would be much apprec
CODE
<? require('config.php'); if($_SESSION['login']!="true") { echo "You are not Authorised Person To See This Page. <br><br> Please Do <b>Login</b>"; } else { $desc=$_GET['decid']; if($desc!="") { include('description.php'); echo "<br><br><br>"; } if($_GET['mainsub']!="" && $_GET['chieldsub']!="") {
$q="select * from `".$_GET['chieldsub']."`"; $r=mysql_query($q); $n=@mysql_num_rows($r); $q1="select * from `subjects` where `id`='".$_GET['mainsub']."'"; $r1=mysql_query($q1); $m=@mysql_fetch_array($r1); $mainsubject=$m['2']; $q2="select * from `subjects` where `sub_head`='".$mainsubject."'"; $r2=mysql_query($q2);
It looks like the problem is with your str_replace() function
CODE
str_replace("_"", ",$sub2[1])
What stringa re you searching for and what string are you trying to replace it with. If you are searching for "_" and replacing it with ", ", then you are missing your comma. Both str_replace instances should be replaced with
Let me know if that helps. On a side note, you might want to consider breaking down those functions into smaller tasks. Like to the str_replace first, save it to a variable, then do the substr, then do the strtolower, etc. If the way you're doing it works though, just keep it going.
Cool, no problem. If you don't mind, click on the "This post was helpful" link under my solution. The board's trying to get in the habit of thanking people who give helpful posts. Post more if you run into problems. Take care.
This post has been edited by akozlik: 2 Jun, 2008 - 12:47 PM
one more thing m8 if possible!! this is code to list the most recent exams uploaded to my site, and it worked fine until i changed some small things. my freelancer is from india, and lately i havent been able to stay up till 3am to ask him to fix it back, and maybe i would understand it better if someone here told me the fix.
CODE
<? $qlu="select * from `topics` order by `upload_date` ASC limit 0,10"; $reslu=mysql_query($qlu); while($rowlu=@mysql_fetch_array($reslu, MYSQL_BOTH)) { echo strtoupper(substr($rowlu['topic_name'],0,1)).strtolower(substr($rowlu['topic_name'],1,20))." ... <br>"; } ?>
see its only showing the first ten uploads in abc order to the site, not the most recent ten. hes a great lancer, but hours are rough for both of us. since the site is officially done, just small tid bits hes fixing free of charge, just gotta catch him.