Search Results

Search found 426 results on 18 pages for 'taylor'.

Page 15/18 | < Previous Page | 11 12 13 14 15 16 17 18  | Next Page >

  • mysql command for update

    - by Mac Taylor
    hey guys i need to add a special text to all rows in my mysql table , how to add some text to the end of all rows' content in a table just for one field i used this code : UPDATE `blogs` SET `title`= `title`+ 'mytext'; but didnt work for me

    Read the article

  • For each result in MySQL query, push to array (complicated)

    - by Dylan Taylor
    Okay, here's what I'm trying to do. I am running a MySQL query for the most recent posts. For each of the returned rows, I need to push the ID of the row to an array, then within that ID in the array, I need to add more data from the rows. A multi-dimensional array. Here's my code thus far. $query = "SELECT * FROM posts ORDER BY id DESC LIMIT 10"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ $id = $row["id"]; $post_title = $row["title"]; $post_text = $row["text"]; $post_tags = $row["tags"]; $post_category = $row["category"]; $post_date = $row["date"]; } As you can see I haven't done anything with arrays yet. Here's an ideal structure I'm looking for, just incase you're confused. The master array I guess you could call it. We'll just call this array $posts. Within this array, I have one array for each row returned in my MySQL query. Within those arrays there is the $post_title, $post_text, etc. How do I do this? I'm so confused.. an example would be really appreciated. -Dylan

    Read the article

  • In what way does Wordpress rewrite page URLs?

    - by Mac Taylor
    Hey Recently I'm interested in post's structure of Wordpress. They use a table named (wp_posts) and in this table they saved 3 related fields such as : post_title post_name guid It's clear that they save title of each story in post_title field , and slugs in post_name , and full url of a post in guild filed . But where the hell, they rewrite these urls in way it appears in browsers : http://localhost/wordpress/about/ There is no htaccess rules for this ! I checked rewrite.php and didn't understand an inch ?! i need to create similar pages , what steps should i take !?

    Read the article

  • Thin down jQuery

    - by Taylor Satula
    Hi, I have been optimizing my website but the one problem that stands in my way is all the jQuery functions that I do not use. The only ones that I use are for a smooth page scroller. It just seems like such a waste of download time. My question is: Is there any script or program that will remove the jQuery code that I do not need and leave the 1 or 2 functions that I do need.

    Read the article

  • problem in wordpress like delete rows in jquery

    - by Mac Taylor
    hey guys im trying to impelement a technique to delete stories with jquery animation exactly like wordpress this is my script part : $(function(){ $('#jqdelete').click(function() { $(this).parents('tr.box').animate( { backgroundColor: '#cb5555' }, 500).animate( { height: 0, paddingTop: 0, paddingBottom: 0 }, 500, function() { $(this).css( { 'display' : 'none' } ); }); }); }); and this is my html part <tr class='box'> <td> <a href=\"edit.php&pid=$pid\">$title</font></a></td> <td >$eki</td> <td> <a href='javascript:void(0)' id='jqdelete'> <img src=\"images/delete.gif\"></a> </td> </tr> but not working am i wrong in any part of my code ? Note : if i use div instead of tr and td , works fine , but i want to use this effect on my table rows thanx

    Read the article

  • in what way wordpress rewrite pages

    - by Mac Taylor
    Hey Recently I'm interested in post's structure of worpress . They use a table named (wp_posts) and in this table they saved 3 related fields such as : post_title post_name guid It's clear that they save title of each story in post_title field , and slugs in post_name , and full url of a post in guild filed . But where the hell, they rewrite these urls in way it appears in browsers : http://localhost/wordpress/about/ There is no htaccess rules for this ! I checked rewrite.php and didn't understand an inch ?! If you were me , and u need to create such pages , what steps you would take !?

    Read the article

  • Hard drive randomly sppeeding up

    - by Glenn Taylor
    Having a weird issue with my hard drive. Running Windows 7 with an I5 processor. At random times the hard drive will start running at top speed and gradually return to normal over the next two minutes or so. Going to Resource Monitor it shows a variety of things with high read or write numbers. Log files NTFS volume log, Windows prefetch, System/user/appdata, and Program data Norton are the usual top ones listed. This just started about three months ago although the computer is about 3 years old. Have run in safe mode with internet over the weekend going to all of my usual sites with no such speed up. Question 1 - what can be causing this? Question 2 - how can I find out where data is being sent(especially if over the net)? Thank you.

    Read the article

  • how to make a div to be center in html

    - by Mac Taylor
    hey guys , one simple way to make an object center in html is using align='center' but belive its not working for a div i used these methods ": style='text-align:center' style='left:50%'; even i use center tag <center> but i couldnt make my target div to be center what way u suggest ?!

    Read the article

  • not case sensitive query in mysql

    - by Mac Taylor
    hey guys i need to query my database and find results : mysql_query("select * from ".ALU_TABLE." where username like '%$q%' or name like '%$q%'"); if i have a name in my table such as Book and i enter book in search box it wont show the Book i need to query my database as not to be case sensitive.

    Read the article

  • how to tidy up html

    - by Mac Taylor
    hey guys look at this website : http://www.vartro.com/ and open up its source wow how tidy it is my question is how can i do such a thing for my website !? my project written in php

    Read the article

  • C++ overloading comparative operators for a MyString class

    - by Taylor Gang
    bool operator == (const MyString& left, const MyString& right) { if(left.value == right.value) return true; else return false; } bool operator != (const MyString& left, const MyString& right) { if(left == right) return false; else return true; } bool operator < (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == -1) return true; else return false; } bool operator > (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == 1) return true; else return false; } bool operator <= (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == -1 || strcmp(left.value, right.value) == 0) return true; else return false; } bool operator >= (const MyString& left, const MyString& right) { if(strcmp(left.value, right.value) == 1 || strcmp(left.value, right.value) == 0) return true; else return false; } So these are my implemented comparison operators for my MyString class, they fail the test program that my professor gave me and could use some direction. Thanks in advance for any and all help I receive.

    Read the article

  • decoding jquery json data in php

    - by Mac Taylor
    hey guys recenlty i made a script to move objects and save the orders now i have a little to do to finish this script everything works fine , just one question : how can i save not numeric data in my json script this is my script : function updateWidgetData(){ var items=[]; $('.widget-title').each(function(){ var weightId=$(this).attr('id'); $('.column').each(function(){ var columnId=$(this).attr('id'); $('.widget', this).each(function(i){ var collapsed=0; if($(this).find('.widget-inside').css('display')=="none") collapsed=1; //Create Item object for current panel var item={ id: $(this).attr('id'), collapsed: collapsed, order : i, column: columnId, weight: weightId }; //Push item object into items array items.push(item); }); }); }); //Assign items array to sortorder JSON variable var sortorder={ items: items }; //Pass sortorder variable to server using ajax to save state $.post('updatePanels.php', 'data='+$.toJSON(sortorder), function(response){ if(response=="success") $("#console").html('<div class="success">Saved</div>').hide().fadeIn(1000); setTimeout(function(){ $('#console').fadeOut(1000); }, 2000); }); } and this is my php script : $data=json_decode($_POST["data"]); foreach($data->items as $item) { //Extract column number for panel $col_id=preg_replace('/[^\d\s]/', '', $item->column); //Extract id of the panel $widget_id=preg_replace('/[^\d\s]/', '', $item->id); $sql="UPDATE widgets SET column_id='$col_id', sort_no='".$item->order."', collapsed='".$item->collapsed."' WHERE id='".$widget_id."'"; mysql_query($sql) or die('Error updating widget DB'); } echo "success"; everything works fine till i use numeric value for columns' id but i need non numeric values forexample id='columnr' i want to extract r but i cant get it right any help plz !?

    Read the article

  • How to successfully Rewrite a URL with .htaccess

    - by Ian Storm Taylor
    Hello. I am trying to rewrite mysite.com/broadcasts to mysite.com/feed so that it will show up in the location bar as "broadcasts" but actually go to /feed. Here is what I have in the .htaccess file: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^broadcasts(/)?$ /feed/ </IfModule> But this isn't working... I get a 404 error. Wondering if I'm doing something stupidly wrong. Thanks!

    Read the article

  • overwriting arguments in t-sql functions

    - by chuck taylor
    I was playing around with some code and realized that it is possible to overwrite the argument to a t-sql function. i.e., create function someFn(@date date) as begin if @date is null set @date = getdate() will set @date to be today's date if the argument was null. This appears only to make any sense if t-sql is treating their arguments as references not values. I realized that I don't actually know what the t-sql rules are for cases like this and was hoping someone could elaborate what is going on here. (I don't ever recall seeing any value vs. reference discussion with respect to t-sql code for that matter actually..)

    Read the article

  • Append to the end of a Char array in C++

    - by Taylor Huston
    Is there a command that can append one array of char onto another? Something that would theoretically work like this: //array1 has already been set to "The dog jumps " //array2 has already been set to "over the log" append(array2,array1); cout << array1; //would output "The dog jumps over the log"; This is a pretty easy function to make I would think, I am just surprised there isn't a built in command for it. *Edit I should have been more clear, I didn't mean changing the size of the array. If array1 was set to 50 characters, but was only using 10 of them, you would still have 40 characters to work with. I was thinking an automatic command that would essentially do: //assuming array1 has 10 characters but was declared with 25 and array2 has 5 characters int i=10; int z=0; do{ array1[i] = array2[z]; ++i; ++z; }while(array[z] != '\0'); I am pretty sure that syntax would work, or something similar.

    Read the article

  • how to restrict a page to only a specified ip range in php

    - by Mac Taylor
    hey guys im looking for a way to restrict my administration page to only my own ip range concider my ip range is 215.67.. so in php i will begin with this : $myip = "215.67.*.*"; $myip = explode(".", $my_ip); $userip = getenv("REMOTE_ADDR") ; $userip = explode(".", $userip); if ($myip[0] == $userip[0] AND $myip[1] == $userip[1] ) { //Contunue admin } is there any better and more professional way to do it ?

    Read the article

  • problem in using while loop in php&mysql

    - by Mac Taylor
    hey guys im using a while loop to show my latest forum topics now i need to count some fields either I'm trying to do it in one query and here is my code : $result = $db->sql_query("SELECT t.*,p.*, SUM(t.topic_approved='1') AS Amount_Of_Topics, SUM(t.topic_views) AS Amount_Of_Topic_Views, SUM(t.topic_replies) AS Amount_Of_Topic_Replies, SUM(p.post_approved ='1') AS Amount_Of_Posts FROM bb3topics t left join bb3posts p ON t.topic_id=p.topic_id ORDER BY t.topic_last_post_id DESC LIMIT 10 " ); while( $row = $db->sql_fetchrow($result) ) { problem : this code shows only one forum topic and not the rest , but if i remove sum() part from it , then it shows the rest is there anything wrong with my query code ?!

    Read the article

  • converting ip to long string in mysql command !

    - by Mac Taylor
    hey guys I'm trying to use ip2country technique to show my users'flags simple thing to do is to write a sql statement and show users from session table and then query to see if their ip is in what range and show their flags it simple but dengerous becuase when showing 300 users online and fetching from session table and then query once again ip2country table to get the flags there will be surelly memory overusage problem now i wrote a query to make it in one query : SELECT s.session_ip,ipc.* FROM session s left join ip2country ipc ON ipc.ip_lo<=s.session_ip AND ipc.ip_hi>=s.session_ip WHERE s.session_time > '".( time() - 60) )."' now its clear above query is wrong cause ips saved in ip2country table is long string 1000013824 and ips saved in session table are real ip e.g. 193.169.0.0 now i know how to convert from ip to long in php ip2long() but is there any command in mysql to do it with out building another query !?

    Read the article

  • PHP OOP class Sensative To Counter field name !

    - by Mac Taylor
    hey guys recently i managed to write a class for my stories , and everything is fine , unless counter field that stores page's hits here is my class : class nk_posts { var $data = array(); public function _data() { global $db; $result = $db->sql_query(" SELECT bt_stories.*, bt_tags.*, bt_topics.*, group_concat(DISTINCT bt_tags.tag ) as mytags, group_concat(DISTINCT bt_topics.topicname ) as mytopics FROM bt_stories,bt_tags,bt_topics WHERE CONCAT( ' ', bt_stories.tags, ' ' ) LIKE CONCAT( '%', bt_tags.tid, '%' ) AND CONCAT( ' ', bt_stories.associated, ' ' ) LIKE CONCAT( '%', bt_topics.topicid, '%' ) AND time<=now() AND section='news' AND approved='1' GROUP BY bt_stories.sid ORDER BY bt_stories.sid DESC "); while ($this->data = $db->sql_fetchrow($result)) { $this->sid = $this->data['sid']; $this->title = $this->data['title']; $this->counter = $this->data['counter']; //------Rest of Fields ------ $this->_output(); } } public function _output() { themeindex( $this->sid, $this->title, $this->counter, //------Rest of Fields ------ ); } } problem this class can't show counter filed value , but if i change counter field name to other thing like hit , .. everything goes fine im sure its okay if i write it in normal php mysql way , but i need this to be in OOP way any comment why it's sensitive to counter field name ?!

    Read the article

  • query mysql table and fetch rows posted in 3 days

    - by Mac Taylor
    Hey guys how can i query my mysql database and fetch rows which are posted in earlier 3 days i know how to fetch todays's rows but not 3 days ago time will save in my table like this : 2010-01-20 19:17:49 and this is what i know : SELECT id FROM pages WHERE date=now() but i need to show posts in 3days and im looking for a simple and straight solution ,because i know how to do so in long php codes

    Read the article

  • pathogen#infect not updating the runtimepath

    - by Taylor Price
    I have started working with pathogen.vim with gvim on Windows, following Tim Pope's setup guide at his github repository here. However, I'm running into the problem that pathogen#infect() does not seem to be modifying the runtimepath (as seen by running :echo &runtimepath in gvim). The simple test case _vimrc that I came up with is as follows. Please note that pathogen gets loaded just fine. "Set a base directory. let $BASE_DIR='H:\development\github\vimrc' "Source pathogen since it's not in the normal autoload directory. source $BASE_DIR\autoload\pathogen.vim "Start up pathogen call pathogen#infect() "call pathogen#infect('$BASE_DIR\functions') Neither running pathogen#infect() without an argument (which should add the bundles directory under the vimfiles directory) nor specifying a directory to contain files works. Substituting the pathogen#infect() call with pathogen#runtime_prepend_subdirectories('$BASE_DIR\functions'), which is what pathogen#infect() does fails to change the runtimepath as well. Any ideas that I've missed? Any more information that would be helpful? My repository with the non-trivial example is here.

    Read the article

  • Write a program for a report derived from the data in the data file JEWELRY. The data is to be input

    - by Taylor
    here is the JEWELRY file 0011 Money_Clip 2.000 50.00 Other 0035 Paperweight 1.625 175.00 Other 0457 Cuff_Bracelet 2.375 150.00 Bracelet 0465 Links_Bracelet 7.125 425.00 Bracelet 0585 Key_Chain 1.325 50.00 Other 0595 Cuff_Links 0.625 525.00 Other 0935 Royale_Pendant 0.625 975.00 Pendant 1092 Bordeaux_Cross 1.625 425.00 Cross 1105 Victory_Medallion 0.875 30.00 Pendant 1111 Marquis_Cross 1.375 70.00 Cross 1160 Christina_Ring 0.500 175.00 Ring 1511 French_Clips 0.687 375.00 Other 1717 Pebble_Pendant 1.250 45.00 Pendant 1725 Folded_Pendant 1.250 45.00 Pendant 1730 Curio_Pendant 1.063 275.00 Pendant this is the program i have used #include <iostream> #include <string> #include <iomanip> #include <fstream> using namespace std; struct productJewelry { string name; double amount; int itemCode; double size; string group; }; int main() { // declare variables ifstream inFile; int count=0; int x=0; productJewelry product[50]; inFile.open("jewelry.txt"); // file must be in same folder if (inFile.fail()) cout << "failed"; cout << fixed << showpoint; // fixed format, two decimal places cout << setprecision(2); while (inFile.peek() != EOF) { // cout << count << " : "; count++; inFile>> product[x].itemCode; inFile>> product[x].name; inFile>> product[x].size; inFile>> product[x].amount; inFile>> product[x].group; // cout << product[x].itemCode << ", " << product[x].name << ", "<< product[x].size << ", " << product[x].amount << endl; x++; if (inFile.peek() == '\n') inFile.ignore(1, '\n'); } inFile.close(); string temp; bool swap; do { swap = false; for (int x=0; x<count;x++) { if (product[x].name>product[x+1].name) { //these 3 lines are to swap elements in array temp=product[x].name; product[x].name=product[x+1].name; product[x+1].name=temp; swap=true; } } } while (swap); for (x=0; x< count; x++) { //cout<< product[x].itemCode<<" "; //cout<< product[x].name <<" "; //cout<< product[x].size <<" "; //cout<< product[x].amount<<" "; //cout<< product[x].group<<" "<<endl; } system("pause"); // to freeze Dev-c++ output screen return 0; } // end main

    Read the article

  • String Array and ConvertTo-HTML

    - by Taylor Gibb
    I cant for the life of me get the contents of a string array (well its not strictly typed but all the items in the array are strings) to become a table, i am trying to use ConvertTo-HTML. For example: $arr = @("One", "Two") $arr | ConvertTo-HTML I have tried -As List, using fragments, even using InputObject, is it even possible ? Edit: i simply want to know if there is anyway to use an array as the input for the ConvertTo-HTML cmdlet, all it does is make a table with the length property of the strings.

    Read the article

  • switching on and off in jquery

    - by Mac Taylor
    hey my friends i wrote a code to switch on or off the status of a story ( activate or deactivate ) this is my html part : $status_link = $active==1 ? "active.gif" : "inactive.gif"; <span id='status_link'> <a class='change_status' href='javascript:void(0)' id='$pid'> <img src='images/$status_link' class='active_status' id='$active'></a> </span> and this is my jquery code : <script type="text/javascript">$(function(){ $('.change_status').each(function(){ var pid=$(this).attr('id'); $('.active_status').each(function(){ var type=$(this).attr('id'); .click(function(){ $.post("change_status.php"+"&type="+type+"&pid="+pid, function(data){ $('#status_link').html(data).fadeIn("slow"); }); return false; }); }); </script> and a php function that is easy, i dont think its needed i myself think there is a problem with my jquery code how can i change the picture of that image by clicking on it

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18  | Next Page >