taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
multiple querys..to view by Columns in DB...
taquitosensei replied to shane85's topic in PHP Coding Help
page.php?orderby=prospect contact, date, company, city etc.. then your sql switch($_GET['orderby']) { case "contact": $orderby="contact_next field"; break; case "date": $orderby="date field"; break; case "company": $orderby="company field"; break; case "city"; $orderby="city field"; break; case default: $orderby="prospect_id"; break; } $sql="select * from prospects ORDER BY ".mysql_real_escape_string($orderby)." DWSC '.$queryLimit; -
You'll need javascript to do that. If you're already using javascript you might as well use the jquery datepicker it would look a lot cleaner. You click on the text field and It pops up a calendar, when you click on the date it fills in the text field.
-
Display only certain data from text file
taquitosensei replied to Bricktop's topic in PHP Coding Help
$text_exp=explode("||", $text); if($text_exp[2]=="category1") { // do whatever here } -
undefined variable problem to populate text area
taquitosensei replied to Murciano's topic in PHP Coding Help
This should do it <textarea name="editor1"><?php echo (isset($editor1))?$editor1:""; ?></textarea> -
to modify yours if ($search) { $order_crit .= " AND (o.order_id LIKE '%{$search}' "; $order_crit .= "OR acct.acct_first LIKE '%{$search}%' "; $order_crit .= "OR acct.acct_last LIKE '%{$search}%' "; $order_crit .= "OR acct.acct_company LIKE '%{$search}%' "; $order_crit .= "OR acct.acct_email LIKE '{$search}%' "; $order_crit .= "OR bt.bill_country LIKE '%{$search}%' "; $order_crit .= "OR bt.bill_zip LIKE '%{$search}%' "; $order_crit .= "OR bt.bill_city LIKE '%{$search}%' "; $order_crit .= "OR bt.bill_state LIKE '%{$search}%' "; $order_crit .= "OR bt.bill_phone LIKE '%{$search}%') $order_crit.=" OR (is_wholesale=1 and bt.bill_state LIKE '%{$search}%') "; }
-
I might know. But I definitely don't without knowing what the issues are.
-
you'll have to decode it. If you have php 5.1 ( I think it might be 5.2 ) you can use the built in function $array=json_decode($arraywithyourjsonconents); foreach($array as $k=>$v) { } //or for($a=0;$a<count($array);$a++) { } if it's before that version of php then you'll have to find a php class. I'm pretty sure there's a pear class available.
-
it looks like you've got double quotes in your double quotes echo "<option value="{$row->game_title}">{$row->game_title}</option>"; should probably be more like this echo "<option value='{$row->game_title}'>{$row->game_title}</option>"; blank page can mean that you're getting a fatal error but display_errors is turned off you can put this at the top of your script while you're developing so you can see the errors ini_set("display_errors","1"); ERROR_REPORTING(E_ALL);
-
It took a bit of hitting my head against the wall to figure that one out.
-
when you use type='submit' it posts the x,y coordinates of the images. The name plus x or y. Try a print_r($_POST) at the top of the page with type='submit' and you'll see what I'm talking about. You should check for one of those instead. Or use a hidden field and check for it. <input type='hidden' name='submitmyform' value='true'> for the x, y if(isset($_POST['submitmyform_x'])); // or submitmyform_y { // do whatever here } for the hidden field if($_POST['submitmyform']) { // do whatever here }
-
Best way of handling include and require paths?
taquitosensei replied to juanpablo's topic in PHP Coding Help
no it's a php function so it doesn't require special permissions. This is how I do it. at the top of each page. require_once 'includes/setpath.php'; // '../includes/setpath.php'; depending on what folder I'm in the contents of setpath.php would be something along these lines. ini_set("include_path",($_SERVER['DOCUMENT_ROOT']."/your/include/path".PATH_SEPARATOR.ini_get("include_path"))); -
Best way of handling include and require paths?
taquitosensei replied to juanpablo's topic in PHP Coding Help
set the include path ini_set("include_path",($_SERVER['DOCUMENT_ROOT']."/your/include/path".PATH_SEPARATOR.ini_get("include_path"))); then it doesn't matter what the current folder is it will look in the include folder. you can add more folders to this also. -
it means you're trying to use more memory than is allocated you can do one of the following memory_limit = 40M to your php.ini file (recommended, if you have access) ini_set('memory_limit', '40M'); at the top of your script or in an included configuartion file php_value memory_limit 40M in your .htaccess you're trying to use more than 32 MB if you think you'll use more than 40, make the number higher.
-
try this <input name="information[]" type="checkbox" class="boxes" tabindex="14" value="Cemetery Planning" /> Cemetery Planning<br /> then foreach($POST['information'] as $information) { }
-
select * from yourtable where timecolumn between date_format(now(),'%H%i') and addtime(date_format(now(),'%H%i'),30) order by rand() limit 15 gets you 15 random rows where the time is between now and 30 minutes from now. replace the appropriate values with your table and column name
-
I was thinking timestamp not time. you'll have to convert it to a unixtimestamp try $eventTime=date("g:i a", strtotime($eventTime));
-
in mysql date_format(); you'll have to check to documentation to get all the options. in php $formatted_date=date("your date options here", $timestampfrommysql);
-
Broken image when displaying an uploaded picture
taquitosensei replied to steve490's topic in PHP Coding Help
Start a new topic. -
escape character newline \n tab \t not working
taquitosensei replied to saiyen2002's topic in PHP Coding Help
that's because in html you should <br> and for tab just use 5 spaces -
Broken image when displaying an uploaded picture
taquitosensei replied to steve490's topic in PHP Coding Help
right click on the broken image and copy the location the paste that into a browser window. Just to make sure the path is correct and the filename is correct. -
you'd have to use some javascript. Jquery has a nifty loading add-on you might want to look at. I think it's just called "loading"
-
Broken image when displaying an uploaded picture
taquitosensei replied to steve490's topic in PHP Coding Help
If that's a relative path get rid of the / at the beginning