|
Why would you not want to use an inbuilt function?
I guess you could copy the array element by element, skipping the one you don't want. Or are you not allowed to use loops either?
|
|
|
|
|
If you really want to do that, move each item into a new array without the one you want to remove from the original.
If you've never failed... You've never lived...
|
|
|
|
|
|
You will do a lot better by asking in the Joomla forum[^]. There's too much learning involved for most of us here - over there they have already climbed that mountain.
Good hunting,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Thank you for your answer!
I've been struggling with this problem for a couple of days now and the joomla communitues shine with their absence when it comes to questions deeper than "name an extension that does this".
In my mind there's something wrong with the logic somewhere since so I was hoping that a higher skilled programmer might been able to see something despite the "joomla syntax"...
Thanks.
// Alekks
|
|
|
|
|
I've had no experience with Joomla, but I have done some simple paddling around in Drupal. I guess I was 'arguing by analogy' in that the Drupal forum is pretty good for people who know how to frame a question (as you do).
Cheers,
Peter
[edit]fixed typos[/edit]
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Hi,
i am creating a user register class using pdo prepared statements etc. But it looks like, something is going wrong in my following code.
I am getting error on the following code in bold -
public function isUsernameTaken($username)
{
$st = $this->getPdo()->prepare("select count(*) as cnt from ".
$this->getDbUserTable()." where username=?");
$row = $st->execute(array($username))->fetch();
if($row['cnt']==0)
{
return false;
}
return true;
}
the error is - Call to a member function fetch() on a non-object
Any idea about the error?
Thanks
modified 10-May-12 10:30am.
|
|
|
|
|
According to my reading of the PHP manual, $st->execute() will return a bool , indicating success/fail of the SQL call. If it succeeded, you can then call $st->fetch() to get the results.
Simple, really.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
How do I restart or shutdown the machine on the same network or access the files in other machines(Computers)?
|
|
|
|
|
Many ways, but it depends on the machines, what OS they are running what type of network connections they have, etc., etc. Try a more explicit question.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
If you have SSH set up, all that is easy... just SSH into the machine you want to control and you can use regular command line commands to restart/shutdown. The alternative to SSH would be to have some sort of remote viewer like VNC, although VNC is not really as flexible as SSH (but it does allow you to view things with a GUI).
To access files, you'll need something like FTP or a Samba share.
|
|
|
|
|
|
Please post your question in one forum only; you already have some suggestions here[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
You can run the system level call play[^].
If you want to do it within your program, you'll have to use ALSA[^] (a low level API) or use something that works at a higher level of abstraction such as PulseAudio[^].
|
|
|
|
|
Hi, guys!
Does anyone know why sometimes gdb tread 'next' as 'continue'?
I tried to debug a generated C++ executable file on linux with gdb, and set a break point in a function 'b myfunction', it inform me that breakpoint setted successfully.
Next, I give the command 'r' to run the program in gdb, and it breaked right at the point 'myfunction', so I started typing 'n' in order to go through whole function, but gdb told me program exited normally!!!
There are many lines in this function, and gdb didn't stop at the first statement of this function, it just went through the left whole program.
Any help would be appreciated
Thanks in advance!
|
|
|
|
|
I haven't used gdb.. but in the MS debugger, if you want to step INTO a function as opposed as just NEXT line, it's a different command. Make sure that's not the case. Also, have you tried setting your breakpoint within the body of the function?
|
|
|
|
|
Hi ,
When I load my calender dynamically my css style classes is not working.When add the styles in line it's working.
Eg.<label id='testlable' name='testlabel' class='test'>Testing css</label> It will not work
But<label id='testlable' name='testlabel' style='color:red'>Testing css</label> It will work.
Please help me load the css as a seperate page.like in the first example.
Thanks
Alex.
|
|
|
|
|
This question might be better in the Web Development[^] forum.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
How do you include your css in your and how do you define the label?
|
|
|
|
|
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
I just copied this from the first Google result for the search "CSS head link" (it was w3schools.com). You might want to try that next time.
Cheers!
|
|
|
|
|
I have an interesting problem with setting up scheduled jobs.
I need to set up a job that will run at 5pm Eastern time when the server is running GMT/BST. Currently we set it up as 10pm, however as daylight saving comes in a week earlier, it will be running at 6pm eastern for that week. Any idea of an easy way to get around this? Changing the server time zone is not an option.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Add CRON_TZ=US/Eastern in the crontab file. All cron implementations don't support that variable, check man 5 crontab on your server.
|
|
|
|
|
Doesn't look like it, I'll have my sys admin look into it.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
If your cron does not support CRON_TZ (see answer drom markkuk), you may write a small utility or bash script that detects non-matching times. Then add two entries to your crontab file:
10 0 * * * /usr/local/bin/TzMatch && MyCommand
# or must it be 9?
11 0 * * * /usr/local/bin/TzMatch || MyCommand
|
|
|
|