Is there a Mysql statement which provides full details of any other open connection or user? Or, an equally detailed status report on myisam tables specifically. Looking at Mysql's SHOW TABLE STATUS documentation, it's missing some very important information for my purpose.
What I'm trying to do: remote odbc connection one is insertin...
I need to compare two dates to show an edit link if it is within 5 mins after the post was made, in php. If after 5 mins dont show anything.
$answer_post_date = get_the_time("Y-m-d");
$current_date = date("Y-m-d");
$formated_current_date = strtotime($answer_post_date);
$formated_answer_post_date = strtotime($current_date);
At this p...
I am creating a website with multiple sections--admin, client, user, and anonymous--each user group having less access then the next. I am wondering what form of authentication would be best for my use?
I have heard the if you are just dealing with a websites then a web form is for you (because it's prettier). HTTP header authentication...
I have a set of points (stored as lat/lon) for a polygon, I want to compute the lat/lon center point of the polygon in PHP.
Basically to do the same thing as the getCenter() function in Google Maps LatLngBounds.
Any ideas on how I can achieve this?
...
Hello Everyone,
I am trying to get my datatable to take a POST JSON output from my server.
This is my client side code:
<script>
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "http://localhost/staff/jobs/my_jobs",
"fnServerData": f...
I think the error has to be in a incompatibility with IE8 and the cookies manipulation, cuz in IE8 you can see the password and login asking screen but when you enter the data and send it the browser seems to do nothing, this is a url you were you can try my code: http://200.8.27.127/tiempo/teacher.php
and this is the code:
<!DOCTYPE ...
Hi everyone, my questions are about login, and changing already saved data.
(Q1) 'Till now I've only saved input in the tables of the database (registration steps), now I need to check if the input (login steps), are the same of my table in database, in fact I have 3 types of users, then I'll have to check 3 kind of tables. Then if the ...
How do I store recent queries in a database?? I know how to find recent searches which is inserted/modified the database but if it isn't inserted/modified then how do I find recent queries???
...
Here's a tricky one - how do I programatically create and interrogate a database whose contents I can't really foresee?
I am implementing a generic input form system. The user can create PHP forms with a WYSIWYG layout and use them for any purpose he wishes. He can also query the input.
So, we have three stages:
a form is designed an...
Hi,
I'd like to know if there is a simple way to fetch data from mysql tables with "correct" data types? What i mean, if field type is for example INT or SMALLINT is it possible to pass those types directly to PHP as integers?
I did some searching and found mysqli_fetch_fields, but for SMALLIT type is 2, for INT 3 and so on. It could b...
Is there a way to order mysql results by the first letter and ignore numbers? For example, I have a list of addresses:
123 Main Street
456 Second Street
234 Third Street
and I want to order by the street name and ignore the street number. Is there an easy way to do this?
...
<?php
$output = <<< END
<table style="display: table;" class="listview rowstyle-rowhighlight" id="resourcegrid">
<thead>
<tr>
<th width="70"></th>
<th style="-moz-user-select: none;" class="sortable fd-column-0"><a class="fdTableSortTrigger" href="#">Name</a></th>
...
Hi, I have this regex for getting the YouTube video ID:
(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=[0-9]/)[^&\n]+|(?<=v=)[^&\n]+
I get it from there: http://stackoverflow.com/questions/2597080/regex-to-parse-youtube-yid
The problem is I get preg_match() Unknown modifier '[' warning.
I know I have to enclose the regex delimiters but I have no ide...
I tried this but only got a syntax error:
<?php
$a = true;
$str = <<< EOF
{$a ? 1 : 2}
EOF;
echo $str;
Is it possible to use such kind of conditional statement inside heredoc?
...
I have a Profile model/controller in my cake app as well as an index.ctp view in /views/profiles. Now, when I go to add a column to my table that is already filled with data, and then add the corresponding code to the view to pick up this column's data, it just gives me an empty result.
My model:
<?php
class Profile extends App...
Explanation
PHP has some holes in its' syntax and occasionally in development a programmer will step in them. This can lead to much frustration as these syntax holes seem to exist for no reason. For example, one can't easily create an array and access an arbitrary element of that array on the same line (func1()[100] is not valid PHP syn...
How can I extract the content between tags with several line breaks?
I'm a newbie to regex, who would like to know how to handle unknown numbers of line break to match my query.
Task: Extract content between <div class="test"> and the first closing </div> tag.
Original source:
<div class="test">optional text<br/>
content<br/>
<br/>
c...
I need a regular in expression in PHP that I can plug into preg_match_all and find if an @ sign and any character number or letter follows right after that. So if I put "@patrick hello there" it will come up true, if I put in "I saw her @ the mall" it will be false.
Thank you :)
...
Hi, can I print the id, even if it's autoincrement ? Because the way I'm doing I'm using an empty variable for id.
$id= "";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die ("Não conectou com a base $database");
mysql_query("INSERT INTO table1(id,...)
VALUES ('".$id."',....)")
or die(mysql_error());
m...
Hi,
I've been having some trouble getting images to download when logged into a website that requires you to be logged in. The images can only be viewed when you are logged in to the site, but you cannot seem to view them directly in the browser if you copy its location into a tab/new window (it redirects to an error page - so I guess t...