Jump to content

barkster

Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by barkster

  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
  16. yeah now that I think about it without a fixed width then it really won't do what I'm trying to do. Since it is 100% then if the last thumb doesn't quite fit then it make it look uncentered. I guess that is what I was really trying to fix. I guess what I'm saying is I want the container hold the thumbs to grow to fit the number of thumbs. Maybe I should just stick in a table?
  17. I'm floating some thumbnail div's inside a container div and I want the container to be the width of the last thumb div on the screen and not the width of the screen how can I do this? I'd also like the container div centered on the screen. I'm terrible with div's and css floating. Thanks .thumb { background-color:#9C6; width:150px; float:left; text-align:center; padding:3px; margin: 0px 5px 5px 0px; font-size:11px; } .pager { margin:5px; padding:3px; background-color:#CC6; text-align:center; font-size:.75em; } #gallery { margin:5px; text-align: center; } #thumbs { margin:0 auto; text-align:center; } <div id="gallery"> <div id="thumbs"> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000452787.jpg"><br>Original Size: 98 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000462788.jpg"><br>Original Size: 109 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000472789.jpg"><br>Original Size: 171 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000482790.jpg"><br>Original Size: 154 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000492791.jpg"><br>Original Size: 97 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000502792.jpg"><br>Original Size: 137 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000512793.jpg"><br>Original Size: 94 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000542794.jpg"><br>Original Size: 40 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000562795.jpg"><br>Original Size: 96 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000572796.jpg"><br>Original Size: 107 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000582797.jpg"><br>Original Size: 112 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000592798.jpg"><br>Original Size: 143 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000602799.jpg"><br>Original Size: 143 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000612800.jpg"><br>Original Size: 198 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000622801.jpg"><br>Original Size: 166 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000632802.jpg"><br>Original Size: 140 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000642803.jpg"><br>Original Size: 168 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000652804.jpg"><br>Original Size: 159 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000662805.jpg"><br>Original Size: 160 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000672806.jpg"><br>Original Size: 119 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000682807.jpg"><br>Original Size: 179 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000692808.jpg"><br>Original Size: 123 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000702809.jpg"><br>Original Size: 120 kb</div> <div class="thumb"><img src="display_thumb.php?id=1&t=n&fname=DSC000712810.jpg"><br>Original Size: 122 kb</div> <div style="clear:both"></div> </div> <div style="clear:both"></div> <div class="pager"> <span class="boxes"><a href="/beta/gallery.php?&page=1">First</a> <a href="/beta/gallery.php?&page=1">prev</a> <a href="/beta/gallery.php?&page=1">1</a> <span class="current">2</span> <a href="/beta/gallery.php?&page=3">3</a> <a href="/beta/gallery.php?&page=4">4</a> <a href="/beta/gallery.php?&page=5">5</a> <a href="/beta/gallery.php?&page=3">next</a> <a href="/beta/gallery.php?&page=10">Last</a> </span> </div> </div>
  18. Thanks, I'll stick with what I have, figured that is what was happening but I just though putting the / in from indicated from "root" but the real root is the "public_html" folder and not the home dir. PFMaBiSmAd, I was just getting access denied cause the folder didn't exist. Thanks for the clarification!
  19. I'm trying to access some files under the home directory, the script accessing the file is in the following directory /home/user/public_html/beta/java/test.php I would think I could access the files in the home directory this way but cannot if(file_exists("/home/user/protected/test.txt")) echo "yes"; but I can only access it this way? What am I doing wrong? Is it trying to reference off of /public_html folder instead? How do I do it from /home dir? Thanks if(file_exists("../../../protected/test.txt")) echo "Yipee";
  20. Yeah thanks, I just moved my preview in a panel on the right of the table and manage visibility/content with javascript. Thanks!
  21. thanks for the detailed response. I was hoping to be able to float it over the next cell that way it doesn't expand the current or even if it covered the existing thumb that would be fine I just don't want to have the table expand/contract... I may have to go about it a different way, maybe just a preview area instead. thanks!
  22. I'm trying to float a div to the right of my thumbnails for each cell with a margin of 150px left so that it is always to the right of the thumb. I want it relative to the table cell. I cannot figure how to make it work. Here is what I have. <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD align=middle> <DIV style="position:relative;"> <IMG src="Untitled Page_files/1971.jpg"/> <DIV id="div0" style="position:absolute; top:0;margin-left:150px;"> <IMG src="Untitled Page_files/1971.jpg"/> </DIV> </DIV> <BR>1971</TD> <TD align=middle> <DIV style="position:relative;"> <IMG src="Untitled Page_files/1971.jpg"/> <DIV id="div1" style="position:absolute; top:0;margin-left:150px;"> <IMG src="Untitled Page_files/1971.jpg"/> </DIV> </DIV> <BR>1971 </TD> </TR> </TBODY></TABLE>
  23. maybe I should stick with it all in one class till I get a grasp on this. I was just using what I could find on extending a class. I think I'm going about this in the wrong direction. I thought that I could call this //create parent object $db = new db_class; //set the $db variable in parent $db->dofunction("db"); //now create the paging object $pg = new paging; //now use the $db variable from the parent object in the paging class in function dofunctionchild() mysql_db_query(parent::db,$sql); $pg->dofunctionchild(); I assumed that by extending the class I could easily use variables and functions between the two. I think I should just leave it in one class and do some more reading. I was just trying to make my class a little smaller and just use the extended class when needed.
  24. hymn, I thought I had tried doing that by using the following but maybe it won't work this way. I'll try it they way you suggest thanks. class db_class { var $var1 function db($db) { $this->var1=$db; } } class paging extends dbclass { var $db; function paging() { $db=parent::var1; } function query() { $sql = "SELECT * FROM Table"; //get the parent variable $var1 $result = mysql_db_query($db,$sql); } }
×
×
  • 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.