Jump to content

SQL Query


cheechm

Recommended Posts

Here is one of my querys have to admit its a little long lol

$query = "SELECT `id`, `mid`, `title`, `author`, `post`, DATE_FORMAT(`date`, '%M %D, %Y') as `date`, TIME_FORMAT(`time`, '%H:%i %p') as `time` FROM `news` ORDER BY `id` DESC LIMIT 50"

 

cause you dont have to have limit x i normally use the myphpadmin tool to do the querys find it a little easier

Link to comment
Share on other sites

The results aren't ordered at all.

 

name 	show 	type 	section
Home Page Text Box	0	0	0
Site Name	1	0	1
Site Online?	1	1	1
Your Postcode:	1	0	0
Your Phone number:	1	0	0
Your Address	1	0	0
Delivery Charge (/mile)	1	0	0
Subtitle	1	0	1
Email Confirmation Required	1	1	1

Link to comment
Share on other sites

INSERT INTO `config` (`value`, `setting`, `name`, `show`, `input`, `section`) VALUES
('insurance value...\r\npat testing\r\nfield company\r\ninvoice table', 'home', 'Home Page Text Box', 0, 0, 0),
('Point', 'name', 'Site Name', 1, 0, 1),
('1', 'online', 'Site Online?', 1, 1, 1),
('1414', 'postcode', 'Your Postcode:', 1, 0, 0),
('077777', 'phone', 'Your Phone number:', 1, 0, 0),
('London', 'address', 'Your Address', 1, 0, 0),
('1.50', 'delivery', 'Delivery Charge (/mile)', 1, 0, 0),
('• Cool Test', 'subtitle', 'Subtitle', 1, 0, 1),
('1', 'email_confirm', 'Email Confirmation Required', 1, 1, 1);

Link to comment
Share on other sites

Nah seems the dump is ok, after all so def the query i wouldnt think it cared but maybe its because not all your items are in 'x'

 

$sql = "SELECT `name,`type` FROM `config` WHERE `section` = '$section' AND `show` = '1' AND `setting` = '$setting' ORDER BY `type` DESC";

 

try that if that fails have to wait for someone else to reply sorry :/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.