Jump to content

barkster

Members
  • Posts

    194
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

barkster's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I have a query like this where I'm trying to query all columns for any matching value but when I try and do my job_number field it will not find any results. SELECT * FROM tasks WHERE MATCH (job_number,client_name) AGAINST ('+097' IN BOOLEAN MODE) taskid job_number client_name 1 21-097 Birch 2 22-884 Smith When I run the query it will not find any tasks matching 097 but will find birch... any ideas. All columns are set to text type
  2. Appreciate all the help, FULLTEXT INDEX does look easier... I'll look at that also
  3. Hey awesome, what was I doing wrong. Looks so similar
  4. I need to query all the fields in the table for multiple keywords. For instance I need to query for "white river" but white and river can be in any of the fields. How can I do this? I'm pretty close here but not exactly right. function queryall($table, $keyword) { $result = mysql_list_fields($this->db,$table); $sql = "SELECT * FROM ".$table." WHERE "; $keywords = explode(' ', $keyword); foreach ($keywords as $kw) { for($i = 0; $i < mysql_num_fields($result); $i++){ if($i!=0) { $kw = get_magic_quotes_gpc() ? trim($kw) : addslashes(trim($kw)); $where[] = mysql_field_name($result,$i)." LIKE '%$kw%'"; } } $whereclause[] = join(" \nOR ", $where); } $sql = $sql . join(" \nAND ", $whereclause); return $sql; }
  5. I'm trying to loop through my smilies when a user types on and I cannot get it to work for smilies that contain the < or > signs. How can I do a replace on those exactly. I've tried using reg ex but can't get it to work either. This is what I'm doing but doesn't work right var smileys = new Object(); smileys[':-O']='smiley-yell'; smileys['']='smiley'; smileys['>:->']='smiley-twist'; for(var index in smileys) { //cleanmsg = cleanmsg.replace(new RegExp(index, 'g' ),'<img class="smiley" src="smileys/'+smileys[index]+'.png" alt="'+index+'">'); cleanmsg = cleanmsg.replace(index,'<img class="smiley" src="smileys/'+smileys[index]+'.png" alt="'+index+'">'); }
  6. I think I figured it out but don't know if it is best way function updatetotal() { var div = document.getElementById('rows'); var obj=div.getElementsByTagName('ul'); var newtotal = 0; for (var i=0; i<obj.length; i++) { console.log(obj[i].getElementsByTagName('LI')[1].firstChild.value); console.log(obj[i].getElementsByTagName('LI')[2].firstChild.value); //console.log(obj[i].getElementsByTagName('LI')[1].firstChild.nodeValue);//use if you want innerhtml of li tag newtotal = newtotal + (obj[i].getElementsByTagName('LI')[1].firstChild.value * obj[i].getElementsByTagName('LI')[2].firstChild.value) } console.log("The Grand total is %s",newtotal); document.getElementById('total').innerHTML = formatCurrency(newtotal); }
  7. sorry can't edit but I'm trying to get value of textbox inside the li tag <div id="rows"> <ul id="1"> <li class="col1">Description1</li> <li class="col2"><input name="qty" type="text" value="1" /></li> <li class="col3"><input name="amount" type="text" value="2.5" /></li> </ul> <ul id="2"> <li class="col1">Description2</li> <li class="col2"><input name="qty" type="text" value="1" /></li> <li class="col3"><input name="amount" type="text" value="30" /></li> </ul> </div>
  8. I have an invocing system that I'm playing with and right now I have several rows of invoice details that have line items with quantity and amounts. I use ajax to update each row onchange but I have yet figured out a way to update my grand total when that happens. How can I loop through the list items onchange to get my new total? Here is an example of the items <div id="rows"> <ul id="1"> <li class="col1">Description1</li> <li class="col2">1</li> <li class="col3">2.50</li> </ul> <ul id="2"> <li class="col1">Description2</li> <li class="col2">3</li> <li class="col3">23.25</li> </ul> </div>
  9. yes that is it, thanks. It was the question mark that I didn't know how to use. Optional instead of or. Thanks!
  10. I forgot to mention it can only be 3-digit, so only 3-digit alpha or 3-digit alpha semicolon space don't know how to make this as an or but need to combine these two or something simlilar ^([A-Za-z]{3})* ^([A-Za-z]{3};\s)*
  11. I have a string that can be any of the following want to make sure it is formatted correctly where if there is more than one entry they are separated by a semicolon and a space and the last entry does not have a semicolon. I cannot figure out how to do this, right now I'm just doing this. So essentially it can either be 3digit alpha or 3-digit alpha plus semicolon and space? Formats Accepted BBB BBB; BBB BBB; BBB; BBB; BBB regex using now ^([A-Za-z; ])*$
  12. Not by me but I'm on a VPS server so I would image I have full access.
  13. I guess what I was asking is what is the database called and the tables associated with the cpanel user and email users. I dug around in the "mysql" database and found cpanel users but can't find the email accounts?
  14. is it possible to access the cpanel database to do your own authentication? I've seen a few hacks at posting to the login page but I would like to build my own login page and have my own user section without going into cpanel? Is this possible? Is the cpanel information stored in mysql? I would like to be able to authenticate cpanel users and email users accounts? Thanks
  15. yeah but I as trying to have it fill the page as the width increased but I may just move to that cause it looks better. Thanks for the help
×
×
  • 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.