
countdrac
Members-
Posts
40 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
countdrac's Achievements

Member (2/5)
0
Reputation
-
Thanks for the answer if you have the time could you please explain to me where/how the exclusion takes place. i really need to learn this stuff... not just copy and paste... thanks again
-
hi im trying to get all the userId's that have been inactive in the last 30 days... so far i have SELECT userid FROM users (all the users) and i have SELECT userid FROM transactions WHERE DATE_SUB(CURDATE(), INTERVAL 28 DAY) <= EndAt so i need to exclude the second query from the first... how do i do that and just end up with the userid's of those not been used in the last 28 days (EndAt is a list of all transaction dates) thanks
-
hi i need to write an application that takes all the files in a directory, move them, and add the information to a DB based on where the files were uploaded to. eg. upload/name1/category2/file.ext needs to move to main/name1/category2/file.ext but the name1, category2 and file.ext all need to be added to a database. im not sure of the best way to do this. im sure there must be a better way to get information from the directories and files then the way i have it at the moment. also if the decide to change how many directories they will be using its a bit of a mess at the moment. at the moment ive got: function listdirs($dir) { static $alldirs = array(); $dirs = glob($dir . '/*', GLOB_ONLYDIR); if (count($dirs) > 0) { foreach ($dirs as $d) $alldirs[] = $d; } foreach ($dirs as $dir) listdirs($dir); return $alldirs; } $dirs = listdirs('../audioUpload'); array_unshift($dirs, "../audioUpload"); foreach($dirs as $dir) foreach (glob($dir."/*.mp3") as $file) { $fileName = split("/*/",$file); $num = count($fileName); echo "<option value='".$file."'>.."; for ($i=2;$i<$num;$i++) echo "/".$fileName[$i]; echo "</option>"; } $file = $_POST['fileID']; $fileName = split("/",$file); $num=count($fileName); $dir = "../audioMain/".$speaker; if(!file_exists($dir)) { if(mkdir($dir,777)) { $dir = "../audioMain/".$speaker."/".$category; if(mkdir($dir,777)) {}else echo"error"; } } else { $dir = "../audioMain/".$speaker."/".$category; if(!file_exists($dir)) if(mkdir($dir,777)) {}else echo"error"; } $newFile = $fileName[0]."/audioMain/".$speaker."/".$category."/".$fileName[$num-1]; $setPath = "../audioMain/".$speaker."/".$category."/"; $query = "INSERT INTO ... .. '".$fileName[0]."/audioMain/".$speaker."/".$category."/', '".$fileName[$num-1]."' if(rename($_POST['fileID'], $fileName[0]."/audioMain/".$speaker."/".$category."/".$fileName[$num-1])) { $dirCheck = $_POST['fileID']; $dir = $dirCheck; $check=split("/",$dirCheck); $numDirs = count($check); for($i=2;$i<$numDirs;$i++) { $dirDel = split($check[$i],$dir); if(is_emtpy_dir($dirDel[0])) { if(rmdir($dirDel[0])) { // echo "DELETED FOLDER: <br />"; } } } } thanks
-
i did. thats how i get the new lines. my question was regarding that i need it to indent, not make a new line one <--- new line two one one one <--- no indent one one one <--- indent how do iget the indent to show? i hope this is more clear
-
hi i have form where a person enters their message in a textarea, this is saved in mysql db and then it needs to be displayed on another page. the problem im having is that lets say someone wants something like this: Blah Blah Blah Blah BlahBlah Blah Blah Blah Blah how can i show the indent when i display it as html? (they use just spaces in the textarea to create the indent) thanks
-
thanks it worked! do you know what the problem was?
-
im having trouble with this ajax! when the javascript function gets called it does what it is supposed but it just puts it in the wrong place - not in the span as its meant to and what is meant to be changed in the span just stays there.... function getSearch() { alert(document.getElementById('searchDiv').value); // this just says 'undefined' document.getElementById('searchDiv').innerHTML = "WHAT???"; //this never appears anywhere ... all othe ajax stuff ... } function StateChangedSearch() { if (xmlHttp.readyState==4) { document.getElementById('searchDiv').innerHTML = xmlHttp.responseText; // this does not insert into 'searchDiv' - it inserts it above where its meant to be } } and then the form and the page.... <form class="uploadForm" name="goNext" onsubmit="return formValidatorUpload()" method="post" > <span id="theForm"> <table> <?php .............. ............ .......... <span id='searchDiv'> <tr><td colspan=1><u>Recently Added Shiurim</u></td></tr>"; $query = "SELECT * FROM shiurim, speakers, category ORDER BY shiur_upload_date DESC LIMIT 5"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<tr><td>"; echo "Speaker: ".$row['speaker_name'] ."<br />"; echo "Title: ".$row['title'] ."<br />"; echo "Year: ".$row['shiur_year'] ."<br />"; echo "Category: ".$row['category_name'] ."<br />"; echo "Description: ".$row['description'] ."<br />"; echo "Date: ".$row['shiur_date'] ."<br />"; echo "<a href='./audioEditShiur.php?shiur_id=".$row['shiur_id']."'>Edit Shiur</a>"; echo "</tr></td>"; } echo "</span>"; .... ?> </table> </span> </form> thanks!
-
im trying to do an INSERT then right away a SELECT (on that insert ) and for some reason the SELECT it returns nothing... im kinda new to mysql... $query = "INSERT INTO category (category_name) VALUES('".$category."')"; $result = mysql_query($query) or die(mysql_error()); $query = "SELECT category_id FROM category WHERE category_name = '".$category."'"; $result = @mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $category_id = $row['$category_id']; } thanks
-
i have two window.onload functions im trying to get working but only one will work... im not sure how to get them both working i think it has to do with the javascript ive written... function init() { getSpeakers(); getCategory(); } window.onload=init; function getspeakers() {....} function getCategory() {....} i dont know what im doing wrong... both functions get some stuff from a db and populate a select box
-
so while trying to debug i did this... <?php session_start(); if (isset($_GET['redir'])) { $redir = "?redir=".$_GET['redir']; $redirIn = $_GET['redir']; } else { $redirIn="admin.php"; $redir="?redir=admin.php"; } if (isset($_SESSION['logged_in'])) { if ($_SESSION['logged_in'] == 1) { echo "logged in... redir "; } } else if (isset($_POST['password'])) { if ($_POST['password'] == "OApass") { $_SESSION['logged_in'] = 1; echo "passwrd logged in... "; } } ?> and the echos are executed exactly where they should be!
-
so what happens is that it just continues to reload the page and doesnt redirect as it should when the correct password is entered
-
for some reason this page does not redirect as it should... very strange... i have no idea why?! <?php session_start(); if (isset($_GET['redir'])) { $redir = "?redir=".$_GET['redir']; $redirIn = $_GET['redir']; } else { $redirIn="admin.php"; $redir="?redir=admin.php"; } if (isset($_SESSION['logged_in'])) { if ($_SESSION['logged_in'] == 1) { header("Location: admin.php"); } } else if (isset($_POST['password'])) { if ($_POST['password'] == "password") { $_SESSION['logged_in'] = 1; header("Location: admin.php"); } } ?> these headers are never executed? thanks
-
on a listbox change i need populate a new listbox getting info from a DB i can get all the info but im sitting with an array in my php form... can someone please explain what the best way to handle an array from the php and then put those into the new listbox... i was thinking i could just return (from php) one long string with a seperator (eg commas) - then i can get each one individually in the JS (when populating the listbox) but there must be an easier way? this is kinda what im having trouble with... while ($row = mysql_fetch_array($result)) { $list[$i][0] = $row['title']; $list[$i][1] = $row['file_name']; $i++; } mysql_close($connection); echo $listArray; //dont really know how to return this properly as an array So this is what i was doing before returning the array... should i keep this one and change the way php returns (string instead of array)? var response = xmlHttp.responseText; var plist = response.split(","); var pfile = ""; var length = plist.length; for (var i=0; i < length-1; i++) { var parshaEl = document.createElement('option'); //create option var El = document.getElementById('list'); El.appendChild(parshaEl); //then append it to the second dropdown list pfile = plist[i].split("##"); //when using the string the string was like title1##filename1,title2##filename2,... pfile[1]+=".inc"; parshaEl.value = pfile[1]; parshaEl.innerHTML = pfile[0]; thanks
-
this is my table: name id description topic year category so now i want to know - i only have around 5 categories so is it worth me have a seperate table for it? this is for a website which i populate a dropdown box with the categories... i just want to know as a design aspect if its better to just hardcode the categories into the html or populate them from the DB (ie making a table for them and getting them from there)? thanks
-
hi i need to check a file to see if its encoded in windows-1250 so ican convert if it is... i cant just convert the files that are in the correct encoding because this adds some strange characters where there shouldnt be does anyone know how i can check? ie if (windows1250($doc)) { iconv(...); } how do i do that check?