<table>
<col width="50%" />
<col width="120" style="min-width: 120px;" />
<col width="50%" />
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
<table style="table-layout: fixed; width: 100%;">
<col/>
<col style="width: 120px;" />
<col/>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
SELECT * FROM menu ORDER BY position
SELECT * FROM `menu` ORDER BY `position`
$pdo = new PDO('mysql:host=locahost;dbname=mydatabase', 'user', 'passsword');
$query->prepare('SELECT * FROM `menu` ORDER BY `position`');
$query->execute();
$menu_all = $query->fetchAll(PDO::FETCH_ASSOC);
function1();
function2();
function3();
function func1(callback) {
...
}
var funcQueue = [func1, func2, ..., funcN];
function callSequently(funcQueue) {
if(funcQueue.length) {
(funcQueue.shift())(function() {
callSequently(funcQueue);
});
}
}
callSequently(funcQueue);
$('table').on('click', 'a.edit_org_cat', function() {
// ...
}
jQuery(function($) {
function reload() {
$.ajax('/path/to/the/script/which/generate/content/page', {
cache: false,
dataType: 'html',
success: function(html) {
$('#content').empty();
$('#content').append(html);
window.setTimeout(reload, 2000);
}
});
}
reload();
});
$col1 = array();
$col2 = array();
$col3 = array();
$sourceFile = fopen('source.csv', 'r');
while($row = fgetcsv($sourceFile)) {
list($col1[], $col2[], $col3[]) = $row;
}
fclose($sourceFile);
$destFile = fopen('dest.csv', 'w');
foreach($col1 as $c1) {
foreach($col2 as $c2) {
foreach($col3 as $c3) {
fputcsv($destFile, array($c1, $c2, $c3));
}
}
}
fclose($destFile);
CREATE TABLE `User` (
`user_id` int not null,
...
);
CREATE TABLE `Product` (
`product_id` int not null,
`product_name` varchar(100),
...
);
CREATE TABLE `UserPrice` (
`user_price_id` int not null,
`user_id` int not null,
`product_id` int not null,
`price` decimal(10, 2) not null,
...
);
SELECT `Product`.*, `UserPrice`.`price`
FROM `UserPrice`
INNER JOIN `Product` ON `Product`.`product_id` = `UserPrice`.`product_id`
WHERE `user_id` = 10