Jump to content

didgydont

Members
  • Posts

    115
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

didgydont's Achievements

Member

Member (2/5)

0

Reputation

  1. Thank you what you suggested did not work for me but you pointed me in the right direction mysql_query("SELECT * FROM jobs INNER JOIN statuses ON jobs.status=statuses.id WHERE statuses.completed = '0' ORDER by jobs.duedate");
  2. hi all I have two tables on a job board 1st table like so "custid,customer,duedate,statusid" the status is just an id wich refrences the second table 2nd table "statusid,stutus,hidden,completed" at the moment i have select * from jobs then if (!functiontocheckifcomplted($row[statusid])==true) { then display stuff here } but it still reads evey mysql job is there a better way to do this ?
  3. Yes yes it is. Thank you very much had been trying to ages to work it out. For such small and tidy funtction its difficult to get whats going on :-\. Once againg thank you very much.
  4. Hi all This probarly looks really bad but im trying to replase tags that change. So far it only replaces the last tag and not well either. I will try to show you function testfunc($value) { if ($value=='gallery'){$return .= "this gallery has worked = --$value--";} if ($value=='email'){$return .= "this email has worked = --$value--";} return $return; } $test = "this is a test {%email%} message {%gallery%} rtfgdsfgdsfg"; $test = preg_replace("#(.*){%(.*?)%}(.*)#is",'$1' . testfunc('$2') . '$3', $test); echo $test; this outputs this is a test {%email%} message rtfgdsfgdsfg but im trying to get this this is a test this email has worked = --email-- message this gallery has worked = --gallery-- rtfgdsfgdsfg Im sure im way off but I hope you can understand. Thank you for taking the time to read this post.
  5. thank you $query = "SELECT type, EXTRACT(YEAR FROM date) year, EXTRACT(MONTH FROM date) month, SUM(Cost) FROM Income where type='income' GROUP BY Year(Date), Month(Date) ORDER BY Date DESC"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['year'] . "-" . $row['month'] . "-" . $row['type']. " - $". $row['SUM(Cost)']; echo "<br />"; }
  6. hi all im trying to display monthly totals but i cant get it to display the the year or month $query = "SELECT type, SUM(Cost) FROM Income where type='income' GROUP BY Year(Date), Month(Date)"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['Date'] . "-" . $row['type']. " - $". $row['SUM(Cost)']; echo "<br />"; } i get this back -income - $360.00 -income - $390.00 -income - $150.00 -income - $150.00 -income - $1140.00 -income - $680.00 -income - $990.00 -income - $780.00 -income - $805.00 -income - $480.00 -income - $480.00 -income - $678.75 -income - $540.00 -income - $1260.00 -income - $1150.00 -income - $710.00 -income - $120.00 no month or year at front i have tried a few other things like $query = "SELECT type, SUM(Cost) FROM Income where type='income' GROUP BY DATE_FORMAT(`Date`, '%Y %m')"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['DATE_FORMAT(Date)'] . "-" . $row['type']. " - $". $row['SUM(Cost)']; echo "<br />"; } still no luck any ideas ?
  7. Hi all Im sending a dynamic created pdf file with php. It gets flagged as spam are things that can be done to help prevent this ? didnt really know where to post it.
  8. hello all i have tried searching and wouldnt know where to begin. basicly i need to preg replace a string but i need to make it like so if string was this "test this string ~~getthisvalue/~~ test" basicly i want to signal a start ~~ and an end /~~ and get and replace the value between with a the value that corrisponds. maybe like ~~1/~~ and 1 might = <img src="test.jpg"> and ~~2/~~ 2 might = company name i hope i have made myself clear
  9. this solves problem echo "<img src='recipeimages/Small/$_GET[image]?time();'>";
  10. hi all i have been playing with ajax and jumploader i can get jumploader to refresh a span no problem. but im trying to make a site where the user can upload 1 image and if the upload another it replace the old image with the same file name. the only problem is the preview box will refresh if there was no image but once i replace the image it show the old image in ie and firefox. any idea i have already added &sid="+Math.random() to the javasript url
  11. this works but i know it could be shorter var xmlHttp function ajaxcheck(str2,str) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="createmember.php" url=url+"?ajaxpost=1" url=url+"&"+str+"="+str2 url=url+"&sid="+Math.random() if (str=="email") { xmlHttp.onreadystatechange=stateChangedemail } if (str=="username") { xmlHttp.onreadystatechange=stateChangedusername } if (str=="password") { xmlHttp.onreadystatechange=stateChangedpassword } xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChangedemail() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("emailcheck").innerHTML=xmlHttp.responseText } } function stateChangedusername() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("usernamecheck").innerHTML=xmlHttp.responseText } } function stateChangedpassword() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("passwordcheck").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
  12. hello all i am trying to make it so the span id refreshed will be the same as the "str" value this is what i have var xmlHttp function ajaxcheck(str2,str) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="createmember.php" url=url+"?ajaxpost=1" url=url+"&"+str+"="+str2 url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("emailcheck").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } this is what i have tried var xmlHttp function ajaxcheck(str2,str) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="createmember.php" url=url+"?ajaxpost=1" url=url+"&"+str+"="+str2 url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged(str) xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged(str) { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById(str).innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } thank you for your time
  13. that would be easy because you could make the results 1 $value and check for the words if all there then display it but it would be a lot of code i just thought there may have been an SQL query for it. thats kool thanx anyway
  14. because that would not narrorow the results down if you searched for the phrase "love shack" it would find every song with the word "love" OR "shack" in it.
  15. this would be the query that doesnt work but its the best way to explain what im trying to do mysql_query("SELECT * FROM songlist WHERE * like '%$quicksearch%' ORDER BY artist"); but if that had worked then i would have been able to do this mysql_query("SELECT * FROM songlist WHERE * like '%$quicksearch[0]%' AND * like '%$quicksearch[1]%' AND * like '%$quicksearch[2]%' ORDER BY artist"); i dont know how else to explain just say if there was 3 key words it would check if word 1 is in artist or song and if word 2 is in artist or song and if word 3 is in artist or song then display the song i can search 1 word or 1 phrase in the same order as the list by mysql_query("SELECT * FROM songlist WHERE artist like '%$quicksearch%' OR song like '%$quicksearch%' ORDER BY artist"); but the problem is if the first word was from the artisit and the second word was from the song it would not work. i realy cant think of any other ways to explain i hope it helps like i said it was just for learing perposes its not important but i would enjoy knowing the answer. thanx for your help so far
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.