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...
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...
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...
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...
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 =...
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...
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...
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...
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...
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...
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"...
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...
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...
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...
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...
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...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.