Tag Archives: mysql
MySQL GROUP BY UNIX TIMESTAMP
I’m trying to fetch a number of rows from a MySQL database and group them by the day they were posted.
End result I would like the following..
Monday
-Article 1
-Article 2
-Article 3
Tuesday
-Article 1
-Article 2… Continue reading
Tagged aggregate-functions, mysql, php
1 Comment
What is best practice when it comes to storing images for a gallery?
My question is not about storing images on disk or in DB.
Images will be stored on disk
Image path and other image data will be saved in database.
Images will be given a unique filename
Images will be stored… Continue reading
Tagged apache, mysql, php, uploadify
2 Comments
redirect 404 to similar urls
i have a website with stories in it. i can have multiple type of stories within multiple categories like:
children
romance
scifi
action
thriler
quests
the sotries are stored (i have a mysql db) using urls like:
www.domain.com/action/story-name-action/
www.domain.com/romance/story-name-romance/
… Continue reading
Tagged .htaccess, http-status-code-404, mysql, php, url-rewriting
1 Comment
$_SESSION created but theres no PHPSESSID in $_SERVER['HTTP_COOKIE']
I’m experiencing some weird problems with SESSION variables on my PHP/Ajax online shopping cart.
When I first view the page, the SESSION is created and works within the page. Then when I navigate to another PHP page within the same… Continue reading
Tagged ajax, mysql, php, session, session-cookies
3 Comments
UPDATE/DELETE in mysql and get the list of affected row ids?
Is there an efficient way to get the list of affected row IDs (not the # of affected rows via PHP’s mysql_affected_rows(), but the actual row ids that were affected) from an UPDATE or DELETE query in mysql?
In postgresql,… Continue reading
Tagged mysql, php, rows-affected
Leave a comment
Phone number format received from twilio
I am storing sms received from twilio in a database so I can use them later. When I did this in the sandbox it worked. However when I upgraded to a regular phone number the number received is the same… Continue reading
Tagged mysql, php, php5, twilio
Leave a comment
Can't insert foreign key value into linking table
I am currently trying to insert data into a table called “customer_quote”, this table acts as a linking table between the “customer” table and the “customer_tariffs” table. It also records the user who sumbitted the data via the “user” table.… Continue reading
Tagged constraints, foreign-keys, mysql, php
Leave a comment
Missing results due to geo proximity formula (store locator)
OK – I’ve been wrestling with this for about 3 months on and off and since I’ve exhausted every geo proximity formula out there that I’ve come across and I’m no closer to getting the right results I figured it… Continue reading
PHP OOP MySQL Programming
I am a beginner in PHP programming and would like help with a little question. Please take a look at the code below:
PHP Code
PHP Code
<?php
class Account
{
public function register()
{
$db_link = mysql_connect("localhost","root",""); // Create… Continue reading
Tagged mysql, oop, php, sql
3 Comments
Is this a 1NF failure?
In considering a 1NF failure, no repeating groups of elements, what if you wanted to have a set limit on the number of a repeating group?
For example, you want a student to only have 3 phone numbers listed. No… Continue reading
Tagged database, mysql, normalization, php, sql
Leave a comment
82 pages
