
ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
Try that {compiler:global,dynamic-typed}var
-
What's in db.php? Where does $pilotid come from? We need more information to give you a solution
-
Ajax altough cURL is your best option. However if this is to prevent fraud your software will be easily fooled as anyone with some PHP knowledge or JS can change those lines installing it nevertheless without you knowing it about.
-
This might be what your looking for: INSERT INTO members (username, club) SELECT concat(upper(left(firstname, 1)), '. ', upper(substr(lastname, 0, 1)), substr(lastname, 1)), club_id FROM users One problem though: upper(substr(lastname, 0, 1)), substr(lastname, 1) This might be able to be simpler but I don't know a function that does something like ucfirst()
-
I have found this page of O'Reilly always usefull http://www.oreillynet.com/pub/a/php/2002/12/05/one_time_URLs.html
-
Joining two tables isn't much of a concern the cartesian product however is: the more rows it has to return the slower it will become. inner join != left join != right join an inner join will add two records to the result if they have a match left and right join will return all rows from the left or right table regardless if they have a match.
-
Get content from table into a list, without repeating.
ignace replied to nonexistentera's topic in PHP Coding Help
It would help if you told us more about your problem and gave us more specifics, like where do you want to use it? If it's SQL then CV's solution will do but you will get one quote per author (last or first, not sure) If you want to create this in HTML using PHP then it would be something like: $result = mysql_query('SELECT * FROM quote ORDER BY author');// it's important to sort by author or the author's name will be duplicated across the page $author = ""; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if (0 === strcasecmp($author, $row['author'])) { echo '<h2>', $row['author'], '</h2>'; $author = $row['author']; } echo '<p>', $row['quote'], '</p>'; } -
First off it's none of your concerns wether or not I read the other replies I'm free to post whatever I want just like mods/admins are free to moderate my post/ban my ass. Mods/Admins not you Second your answer is off-topic and has no value for the OP which is worse? Third I said the same as oni-kun only simpler Fourth after a second look I realize I was confused and mysql_real_escape_string does actually nothing to the md5 string, my apologies (to the OP)
-
Don't perform a real_escape_string on an md5 it will mess up the hash. Hashing it alone is sufficient.
-
New Portfolio, Trying out a new style (need critique)
ignace replied to phpSensei's topic in Website Critique
Nice looks promising. Keep up the good work! -
If you are looking for an object-database you may start by looking at this url http://en.wikipedia.org/wiki/List_of_object_database_management_systems
-
Option 5) Use the Two-Step View pattern of Martin Fowler (http://martinfowler.com/eaaCatalog/twoStepView.html)
-
function insertbefore($stringtosearchin, $wordtofind, $stringtoinsert) { //Insert a string before a string. str_replace($wordtofind,$wordtofind.$stringtoinsert,$stringtosearchin); } This code does nothing until you add a return before str_replace. Equally doing nothing is: $fileedit1handle = "<?php insertbefore You may want to pick up some tutorial on how to properly write PHP code as your code is flawed in multiple sections of your code, a rewrite would be a good option in this case.
-
Well certainly not here. Here your snapshot will be wrong section
-
MERRY CHRISTMAS and a HAPPY NEW YEAR HO HO HO
-
That free service would be Google. Maps in particular.
-
Flash is the way to go here. You can use Ajax and then you get something like Travians. If you also want to know if the success will become a success you may want to do some marketing research to see if people are waiting for something like this.
-
I have to disagree they don't. Tried them as a security measure but some still got passed them albeit losing a limb or two
-
Do you mean that it doesn't show up in view source or on-screen?
-
For example if your application has different sources that all may use sessions then at some point a source may rely on sessions and thus writing something like: $_SESSION['datakey'] = 'datavalue'; Now the line if (!isset($_SESSION)) { session_start(); } Evaluates false and session's does not get started the array _SESSION gets filled with data but is not persisted between requests.
-
In some bad designed applications people use this technique to verify wether or not session has already been started. Normally you don't check _SESSION but session_id() instead as when session's hasn't yet been started session_id() will return ""
-
CREATE TABLE users ( users_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, users_username VARCHAR(16) NULL, users_password VARCHAR(40) NULL, PRIMARY KEY (users_id) ); CREATE TABLE followers ( followers_followee SMALLINT UNSIGNED NOT NULL, followers_follower SMALLINT UNSIGNED NOT NULL, PRIMARY KEY (followers_followee, followers_follower) ); CREATE TABLE tweets ( tweets_id INT UNSIGNED NOT NULL AUTO_INCREMENT, tweets_users_id SMALLINT UNSIGNED NOT NULL, tweets_tweet VARCHAR(140) NULL, tweets_tweet_date TIMESTAMP NULL, PRIMARY KEY (tweets_id, tweets_users_id) ); SELECT tweets_tweet FROM followers, tweets WHERE tweets_users_id = followers_follower AND followers_followee = 1 This example features tweets but it can be modified to meet your needs (followers) in this example defines the relationship between two friends.
-
Add WHERE clause to all sql strings or AND if already exists
ignace replied to DssTrainer's topic in Regex Help
You could use Zend_Db_Select from the Zend framework providing you also would use their database adapter classes you could do: $select = new Zend_Db_Select(new Zend_Db_Adapter_Mysqli(array('host' => 'localhost', 'username' => '', ..))); $select->from('table')->where('..')->where('..')->where('mid = ?', 1); print $select;// returns SELECT * FROM table WHERE .. AND .. AND mid = 1 If you are using PDO to connect to your database you can use one of the Zend_Db_Adapter_Pdo_* classes. -
Pages like msn.com are generally rendered by differing modules