Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. OsakaWebbie

    UTF8 database with one table that doesn't need to be

    I will be making multiple copies of this structure, so little decisions like this will add up. My database has 24 tables, and all but one of them might have multibyte characters entered in them, so the tables are UTF8 with either utf8_general_ci or utf8_unicode_ci collation, whichever seemed to...
  2. OsakaWebbie

    Main filename as seen from inside linked CSS file

    I'm using PHP to construct my CSS output, like this: <link rel="stylesheet" type="text/css" href="style.php" /> Multiple files have the above line in them, and I want to serve up some specific content based on which file is calling it. My thought was to have a switch statement with cases of the...
  3. OsakaWebbie

    PHP file found on flash drive - how could it have been used?

    On a trip where I used a PortableApps-equipped flash drive on hotel computers, I picked up a hitchhiker: a malicious file on my flash drive (no surprise!). But what I can't figure out is how it could have been used by hackers, and whether there is more on my system that I should be looking for...
  4. OsakaWebbie

    Query in loop becomes really slow

    I was having timeout troubles with a certain PHP batch script, and narrowed down the problem to one MySQL statement that is executed in a loop with different values for comparison (it's checking for similar records to data already acquired in another database). Here is one example of the query...
  5. OsakaWebbie

    mb_split misbehaving due to previous character

    I use mb_split (in a UTF-8 environment that can contain Japanese text) to break apart stanzas of song lyrics I have saved in a database, but it doesn't always find the pattern when it should, and the difference seems to be the previous character. This should be really simple: $stanzas =...
  6. OsakaWebbie

    mb_ereg_replace - unexpected greediness

    I have UTF-8 strings with square-bracketed bits interspersed, and some of the text (outside the brackets) is Japanese. Here is an example: 世[C]界中[G]を治[C]めてい[D]る主イエ[G]ス If I apply the following: mb_ereg_replace("\[[^\[]*\]","",$stanza) ...I end up with "世めていス" instead of the expected...
  7. OsakaWebbie

    MVC's Views - class defs or just templates?

    I'm starting to rewrite some code of a big database interface in OOP (my first venture into that world), and I want to do the MVC separation thing if I can get my brain around it. Envisioning models is pretty easy, but I'm not sure about views. When I think about what things in my application...
  8. OsakaWebbie

    Where is my PHP (FastCGI) getting its settings?

    Is there a way to get PHP to tell me where it is checking php.ini files for its settings? It feels like my VPS is haunted by ghost settings I can't find. php.ini files I would expect to have an effect don't, and instead PHP gets its ideas from elsewhere (who knows where). The settings I'm...
  9. OsakaWebbie

    query for match in text with &quot;interruptions&quot; (regex related)

    Yeah, I know the subject line is cryptic... I have a database that keeps song lyrics with chords interspersed within square brackets, like this: [D]Thank you, [D/F#]O my [G]Fa[D]ther, for [G]giving us [A]Your [D A]Son And [D]leav[A/E]ing [D/F#]Your [G]Spirit [D/F#]till the [Em]work on [A]earth...
  10. OsakaWebbie

    preg_replace with backreference AND curly braces

    Trying to use PHP to construct TeX code, and TeX loves curly braces. But in PHP, curly braces are interpreted as part of parsing variables. I have strings like "Dm7 G" (yes, they are guitar chords), and want them to become like "Dm\Sup{7} G". If I do this...
  11. OsakaWebbie

    Favicon when passing PDF?

    Hopefully an easy question. I have an application in a subdirectory, whose favicon is different from that of the parent directory so I have to link it explicitly. For normal code that echoes HTML, I can just do this (outside PHP, or with an echo statement): <link rel="shortcut icon"...
  12. OsakaWebbie

    How to index (or just speed up) a CONCAT of columns in two joined tables

    I have a structure like this: CREATE TABLE person ( PersonID int(11) unsigned NOT NULL auto_increment, FullName varchar(100) NOT NULL default '', HouseholdID int(11) unsigned NOT NULL default '0', (...other fields...) PRIMARY KEY (PersonID), KEY Furigana (Furigana), KEY FullName...
  13. OsakaWebbie

    Store expressions in array, then use in a loop?

    I build an HTML table based on data from a database, and depending on various user options, which columns are included changes quite a bit. I used to repeat a complex conditional structure three times: for an array of the class names and a parameter used to set up jQuery code, for the column...
  14. OsakaWebbie

    FTP on cron: how to be silent except errors

    I made a cron script to do some backups and FTP them offsite. Everything is running fine, but I still get an email with "Interactive mode off." Here is the relevent part of my script: ftp -n $REMOTESERVER <<INPUT_END quote user $LOGIN quote pass $PASSWORD prompt off put myfile1.tar.gz put...
  15. OsakaWebbie

    JOIN of SELECT not working

    I have a table called contact: `ContactID` int(11) unsigned NOT NULL auto_increment, `PersonID` int(11) unsigned NOT NULL default '0', `ContactTypeID` int(11) unsigned NOT NULL default '0', `ContactDate` date NOT NULL default '0000-00-00', `Description` text As you can probably imagine, it...
  16. OsakaWebbie

    Gettext: translation partial &quot;override&quot; or &quot;cascade&quot; possible?

    I have a bilingual application that has one main spot for the code (which is continually being developed) but several clients on virtual hosts. For ease of maintenance I want to keep a single main locale directory (so that when I add new strings I only have to update one place). But I also want...
  17. OsakaWebbie

    Serving up CSS images from outside document root

    From a single document root (where all my PHP files are located for a database interface), I have set up code to access client-specific files from another directory (/var/www/clientname/). One of the types of files I get from there is CSS, so that each client can have their own colors and such...
  18. OsakaWebbie

    What could have happened to my permissions?

    Suddenly my development user can't write its own files - what did I mess up? I first noticed the problem in FTP, and used SSH to investigate. Here's a transcript that shows the situation: [root@vps-1011517-5697 codebase]# grep ^dev /etc/passwd dev:x:506:500::/var/www/:/bin/bash...
  19. OsakaWebbie

    Two counts in one query?

    I have a table "person" that is a misnomer because it actually holds both people and the organizations they can belong to. Another table called "perorg" holds those membership relationships by having columns PersonID and OrgID that both point to the PersonID field in the person table. I'm...
  20. OsakaWebbie

    Brain-twister with aggregates

    Can someone help me figure out how to do this without it being really slow? I have a table "attendance" to show what days a person is present at something, with these fields: PersonID -> points to person table EventID -> points to event table AttendDate: date of attendance I need to do a...

Part and Inventory Search

Back
Top