Solved

I can't get the results of a php mysql query to display

Posted on 2011-02-26
36
557 Views
Last Modified: 2012-05-11
Hello,
I am trying to send a select query to mysql database on my local machine, but it isn't displaying any results or any errors. If i run a php file without the mysql query, results are displayed e.g. displaying the date and time
I'm using Apache 2.2
The code I am using is below. Any help would be greatly appreciated. I have been trying for days to find out what is wrong. The query runs fine and returns the results,  in a command window:

<html>
<head><title>MySQL Test</title></head>
<body>
<?
/* declare some relevant variables */
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "TwigaLodge204";
$DBName = "mail_management";
$table = "Country_data";

mysqli_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysqli_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$result=mysqli_query($query);
$num=mysqli_numrows($result);
mysql_close();
echo $num;

echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>";

$i=0;
while ($i < $num) {
 
$cname=mysql_result($result,$i,"country_name");
$Pforcezone=mysql_result($result,$i,"Pforce_zone");
$RMunsorted=mysql_result($result,$i,"RMIE1");

 
echo echo "".$cname.": ".$pforcezone.": ".$RMunsorted."";
 
$i++;
}

?>


</BODY></HTML>
0
Comment
Question by:TrevorParnhamntl
  • 14
  • 11
  • 9
  • +1
36 Comments
 
LVL 34

Expert Comment

by:Beverley Portlock
Comment Utility
$num=mysqli_numrows($result);

should be

$num=mysqli_num_rows($result);
0
 
LVL 34

Expert Comment

by:Beverley Portlock
Comment Utility
Also, sometimes you use mysql_ and sometimes mysqli_

One final point, if that is a genuine password in your code sample then get it changed NOW. This is a public forum and you should never put passwords here for the whole internet to see.
0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
Hello,

I have noticed several issues with your code:

1. mysqli_numrows should be mysqli_num_rows.
2. you also need to be clear about whether you want to use mysql_ or mysgli_
3. I think you are over thinking the while loop. Try

while($row = mysqli_fetch_array($result)) {
    // code to execute
}

Open in new window


in which case you dont need the mysql_result bit, but rather:
$cname = $row['cname'];

Open in new window


Lastly, you HTML is malformed. I see table headers for just two columns, and there are no actual table rows in your loop, then the table is also not closed.

If you can describe exactly what results you want to display, i'd be willing to help.
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Thanks madaboutasp
Sorry, the code has got a bit messy when I've been trying various things.
Basically, I want to query a database and the display the results of that query as html on a webpage. It seems as though the php script is connecting to the database ok, but either not retruning a result or not displaying it. I would have thought if it wasn't returning a result I would still see some output if only to say nothing has been returned. As I say, the query woeks fine in a command console
0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
I have just notices another issue where you define your SQL statement. You defined that as $sqlquery, but then your mysqli_query function call just $query.
0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
Here is the correct form:

$sqlquery = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$result=mysqli_query($sqlquery);

Open in new window

0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
In terms of the display try one of the following:

<?php
// only display table if there are rows
if(mysqli_num_rows($sql) > 0) {
?>
<table border="1">
  <tr>
    <th>Column Heading 1</th>
    <th>Column Heading 2</th>
    <th>Column Heading 3</th>
    <th>Column Heading 4</th>
    <th>Column Heading 5</th>
    <th>Etc...</th>
  </tr>
  <?php
  while($row = mysqli_fetch_array($sql)) {
  ?>
  <tr>
    <td><?php echo $row['column_name_1']; ?></td>
    <td><?php echo $row['column_name_2']; ?></td>
    <td><?php echo $row['column_name_3']; ?></td>
    <td><?php echo $row['column_name_4']; ?></td>
    <td><?php echo $row['column_name_5']; ?></td>
    <td><?php echo $row['etc']; ?></th>
  </tr>
  <?php
  }
  ?>
</table>
<?php	
} else {
	echo "Query did not return any data.";	
}
?>

Open in new window


or, if you like your field names as variables

<?php
// only display table if there are rows
if(mysqli_num_rows($sql) > 0) {
?>
<table border="1">
  <tr>
    <th>Column Heading 1</th>
    <th>Column Heading 2</th>
    <th>Column Heading 3</th>
    <th>Column Heading 4</th>
    <th>Column Heading 5</th>
    <th>Etc...</th>
  </tr>
  <?php
  while($row = mysqli_fetch_array($sql)) {
	  // convert all non numeric field (column) names to variable
	  foreach($row as $key=>$val) {
			if(!is_int($key)) {
				${$key} = $val;	
			}  
	  }
  ?>
  <tr>
    <td><?php echo $column_name_1; ?></td>
    <td><?php echo $column_name_2; ?></td>
    <td><?php echo $column_name_3; ?></td>
    <td><?php echo $column_name_4; ?></td>
    <td><?php echo $column_name_5; ?></td>
    <td><?php echo $etc; ?></th>
  </tr>
  <?php
  }
  ?>
</table>
<?php	
} else {
	echo "Query did not return any data.";	
}
?>

Open in new window

0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
I've implemented your suggestions but now I'm getting a HTTP 500 error in IE.
In your code should $sql actually be $sqlquery? I've tried it either way but get the same result.
Here is my amended code, can you see where I'm wrong now?
<html>
<head><title>MySQL Test</title></head>
<body>
<?php
/* declare some relevant variables */
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "TwigaLodge204";
$DBName = "mail_management";
$table = "Country_data";

mysqli_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysqli_select_db("$DBName") or die("Unable to select database $DBName");
 
$sqlquery = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$result=mysqli_query($sql);

$num=mysqli_num_rows($result);
mysqli_close();
echo $num;
<?php
// only display table if there are rows
if(mysqli_num_rows($sql) > 0) {
?>
<table border="1">
  <tr>
    <th>Column Heading 1</th>
    <th>Column Heading 2</th>
    <th>Column Heading 3</th>
   
  </tr>
  <?php
  while($row = mysqli_fetch_array($sql)) {
  ?>
  <tr>
    <td><?php echo $row['country_name']; ?></td>
    <td><?php echo $row['Pforce_zone']; ?></td>
    <td><?php echo $row['RMIE1']; ?></td>
   
 </tr>
  <?php
  }
  ?>
</table>
<?php      
} else {
      echo "Query did not return any data.";      
}


?>


</BODY></HTML>
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
Try this mods below...
<html>
<head><title>MySQL Test</title></head>
<body>
<?php
/* declare some relevant variables */
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "TwigaLodge204";
$DBName = "mail_management";
$table  = "Country_data";

mysqli_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysqli_select_db($DBName) or die("Unable to select database $DBName");

$sql = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$res = mysqli_query($sql); 

$num = mysqli_num_rows($res);
mysqli_close();
echo 'Total rows found: '.$num;

// only display table if there are rows
if( $num > 0 ) {
?>
<table border="1">
  <tr>
    <th>Column Heading 1</th>
    <th>Column Heading 2</th>
    <th>Column Heading 3</th>
   
  </tr>
  <?php
  while( $row = mysqli_fetch_array($res) ) {
  ?>
  <tr>
    <td><?php echo $row['country_name']; ?></td>
    <td><?php echo $row['Pforce_zone']; ?></td>
    <td><?php echo $row['RMIE1']; ?></td>
 </tr>
  <?php
  }
  ?>
</table>
<?php      
} else {
      echo "Query did not return any data.";      
}
?>
</body>
</html>

Open in new window

0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
Tried to make it simple, pay attention to this :

$sql = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$res = mysqli_query($sql);

$sql should only used ONCE on $res
For rest of codes below $sql ... you should use $res
See here:
$num = mysqli_num_rows($res); // No $sql
$row = mysqli_fetch_array($res) // No $sql

I hope you got the point cos I seen you write a lot of $sql where you should have write $res

PS: I shorten $sqlquery to $sql AND $result to $res
0
 
LVL 11

Assisted Solution

by:Ovid Burke
Ovid Burke earned 250 total points
Comment Utility
I guess I may have confused you by not including my query in my last few posts. I figured you would just replace what was relevant to do so. Sorry about that. I tend to eliminate a few steps in my code as well by combining finctions, etc.

Here we go then:

<?php

// i tend to combine everything here into one statement
$result = mysqli_query("SELECT * FROM $table WHERE RMIE1 = 'EU'") or die('ERROR: ' . mysqli_error());

?>
<html>
<head><title>MySQL Test</title></head>
<body>
<?php
// only display table if there are rows
if(mysqli_num_rows($result) > 0) {
?>
<table border="1">
  <tr>
    <th>Country</th>
    <th>Pforce zone</th>
    <th>RMIE1</th>
  </tr>
  <?php
  while($row = mysqli_fetch_array($result)) {
  ?>
  <tr>
    <td><?php echo $row['country_name']; ?></td>
    <td><?php echo $row['Pforce_zone']; ?></td>
    <td><?php echo $row['RMIE1']; ?></td>
  </tr>
  <?php
  }
  ?>
</table>
<?php	
} else {
	echo "Query did not return any data.";	
}
?>

</body>
</html>

Open in new window

0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Onemadeye and madaboutasp.

I've tried both of your solutions and I'm getting HTTP 500 error on both of them.
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
@TrevorParnhamntl:
There's nothing wrong with the codes as I tried it locally before paste here.
HTTP 500 error is not an error caused by PHP codes (as you can read: Internal Server Error).
Try to use your very first codes and let know if you still receive 500 error ... or check your htaccess or to any modifications you recently made.
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
or try to empty DBname -> $DBName = "";
The error message should be Unable to select database and not HTTP 500 error.
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Onemadeye,
I ran my original code, (with corrections) and don't get the http 500 error, it just doesn't display anything.
Http 500 error  also suggests that it could be a syntax error in the code
"Most likely causes:
•The website is under maintenance.
•The website has a programming error."
I've also tested the search in a command console again and that is fine,
What happens if you run my original code on your machine?
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
@TrevorParnhamntl:
Actually I dont even bother myself to run your original code because as you know you made a lot of misTyping there ($sqlquery , $query, etc).
What I actually did is modify the codes you provide on #34987780 above.

But I think I found out the problem ... when testing locally I use mysql instead of mysqli :(

Well, try this one now:
<html>
<head><title>MySQL Test</title></head>
<body>
<?php
/* declare some relevant variables */
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "TwigaLodge204";
$DBName = "mail_management";
$table  = "Country_data";

$mysqli = new mysqli();
$mysqli->connect($DBhost, $DBuser, $DBpass, $DBName);

$query  = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$result = $mysqli->query($query);

$num = mysqli_num_rows($result);

// only display table if there are rows
if( $num > 0 ) { 
	echo 'Total rows found: '.$num;
?>
<table border="1">
  <tr>
    <th>Column Heading 1</th>
    <th>Column Heading 2</th>
    <th>Column Heading 3</th>
  </tr>
<?php
	while( $row = $result->fetch_array() ) 
	{ 
?>
  <tr>
    <td><?php echo $row['title']; ?></td>
    <td><?php echo $row['post_date']; ?></td>
    <td><?php echo $row['seo_title']; ?></td>
 </tr>
<?php
	} // END while
?>
</table>
<?php      
} else {
      echo "Query did not return any data.";      
} // END else

//Free result, deletes the query results.
$result->free();
//Closes connection.
$mysqli->close();
?>
</body>
</html>

Open in new window

0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Onemadeye
I tried your code and still get the same HTTP 500 error. I looked at the apache error log and found this;
[Sun Feb 27 18:19:02 2011] [client 127.0.0.1] PHP Fatal error:  Class 'mysqli' not found in C:\\Apache2.2\\htdocs\\onemadeye.php on line 12
I had saved your code as onemadeye.php
Are you sure you tested this locally? I think the line the error refers to is not legitimate php code

I ran my code again with no error and on examining the apache error log there is nothing.

I've also tried both codes in firefox and although I don't get an error on your code when I view the source code, all that is there is ;
<html>
<head><title>MySQL Test</title></head>
<body>
On my code all the code is in the source.

I'm beginning to think that there is nothing wrong with my code (corrected) , but that the problem may be a system error of some sort. The fact that I get the sme result in both IE and Firefox< i think may suggest this.

Madaboutasp: Do you have any experience of this or any suggestions? Or any other contributor for that matter.

0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
@TrevorParnhamntl:
Yes, I have tested my solution #34988972 locally but I'm using XAMPP with MySQL database and the codes works fine. Well, actually in development I use mysql_ instead of mysqli_ but in my codes #34988972 I tried to adopt it to mysqli_ to suits your task.

Do you really need to do it with mysqli_ ?
Or have you tried to work on your codes with mysql_ instead of mysqli_ ?
Or you're not sure and just select mysqli_ instead of mysqli_ ?

I mean like this... just reLook at your codes on first post and pay attention to this :
// .....
mysqli_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
// ...
// mysql_close();
// ...

Open in new window


You connect to DB with mysqli_connect and close it with mysql_close
Do you want me to adopt my codes to use mysql_ to try it on your PC ?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
Here once again I adopt your codes and only use mysql_ for connection and query
Let know if this works on your side ...

<html>
<head><title>MySQL Test</title></head>
<body>
<?php
/* declare some relevant variables */
$DBhost = "localhost";
$DBuser = "root";
$DBpass = "TwigaLodge204";
$DBName = "mail_management";
$table  = "Country_data";

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db($DBName) or die("Unable to select database $DBName");

$sql = "SELECT * FROM $table WHERE RMIE1 = 'EU'";
$res = mysql_query($sql); 

$num = mysql_num_rows($res);
mysql_close();

// only display table if there are rows
if( $num > 0 ) { 
echo 'Total rows found: '.$num;
?>
<table border="1">
  <tr>
    <th>Column Heading 1</th>
    <th>Column Heading 2</th>
    <th>Column Heading 3</th>
   
  </tr>
  <?php
  while( $row = mysql_fetch_assoc($res) ) {
  ?>
  <tr>
    <td><?php echo $row['country_name']; ?></td>
    <td><?php echo $row['Pforce_zone']; ?></td>
    <td><?php echo $row['RMIE1']; ?></td>
 </tr>
  <?php
  }
  ?>
</table>
<?php      
} else {
      echo "Query did not return any data.";      
}
?>
</body>
</html>

Open in new window

0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
@TrevorParnhamntl:

Questions:

1) What OS are you using?
2) What version of PHP?
3) Ar you sure PHP is configured to use mysqli?
4) Can you post the text of the 500 Error here?
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
madaboutasp
1. OS Vista home premium service pack 2
2. PHP version 5.2.17
3. I believe it is as the php version is displayed on the apache service monitor (Apache/2.2.16(win32) PHP/5.2.17)
4.[Sun Feb 27 20:24:38 2011] [client 127.0.0.1] PHP Fatal error:  Call to undefined function mysqli_connect() in C:\\Apache2.2\\htdocs\\onemadeye.php on line 12

It seems to be that if the server, user etc are entered as variables this error is produced, but if you enter them directlty, there is no error, but nothing is displayed.

I've checked the entries in php.ini and the ones I think are relevant all seem to be ok
extension=php_mysqli.dll
extension_dir = "C:\PHP\ext"
 session.save_path = "C:\Windows\Temp"
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
@TrevorParnhamntl:
Have you tried my revised codes on #34992593 ?

Let me know...
0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
What you have reported seems to suggest that your current server configuration does not like the mysqli extension. Can you verify that php_mysqli.dll is in C:\PHP\ext?
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Onemadeye

Sorry, Yes and the result was the same
.[Sun Feb 27 20:24:38 2011] [client 127.0.0.1] PHP Fatal error:  Call to undefined function mysqli_connect() in C:\\Apache2.2\\htdocs\\onemadeye.php on line 12

0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
madaboutasp

Yes php_mysqli.dll is in c:\php\ext
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Interstingly, if I enter the server, user and password as text in single quotes, as opposed to in variables, it doesn't produce an error but the page is still blank
0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
Not even the messages that you output using die()?

Our challenge is, I am sure Onemadeye also agrees, is that we are unable to replicate the errors that you describe.

Let's try something else. Put this code at the top of your script then run it again and let us know the outcome:
error_reporting(E_ALL);

Open in new window


0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
It produces exactly the same HTTP 500 error and the same error log in apache
0
 
LVL 11

Expert Comment

by:Ovid Burke
Comment Utility
Have you tried using mysql_ rather than mysqli_?
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
Yes, with exactly the same result.
I'm coming to the conclusion that this is a system error on my laptop. I've tried it on firefox and safari, as well as IE and all report the same issue.
I'm going to install everything on a different machine and see what happens.

Any tips to make sure the installation is correct?
0
 
LVL 5

Assisted Solution

by:onemadeye
onemadeye earned 250 total points
Comment Utility
@TrevorParnhamntl:
BTW in response to your error:
.[Sun Feb 27 20:24:38 2011] [client 127.0.0.1] PHP Fatal error:  Call to undefined function mysqli_connect() in C:\\Apache2.2\\htdocs\\onemadeye.php on line 12

I'm definitely sure it's not the error of my revised codes on 02/28/11 02:29 AM, ID: 34992593
Because in that revised codes I dont use any mysqli_ just mysql_
Or perhaps.. have you refresh your browser to see the updated page?

So, now please try to run my revised codes on 02/28/11 02:29 AM, ID: 34992593 and dont forget to refresh the browser to see the new page loads...
If still you receive errors .. mmhh ... I dunno ... perhaps I have to ask have you ever run a working PHP script on that machine (no offense, just in case this is the first time you run PHP script on that machine).

TIPS to make sure correct installation:
Have you save your time by installing one-stop-PHP-solution for developing purposes on your local machine? I mean something like XAMPP for Windows or WAMP or EasyPHP instead of manually installing Apache and PHP ? Of course unless you have a specific reason why you install Apache and PHP manually...
0
 
LVL 1

Author Comment

by:TrevorParnhamntl
Comment Utility
onemadeye

I just ran your script again, with the same result. When I originally ran it I changed to mysqli to see if it made a difference.

I originally tried to install wamp, but it failed to install either Mysql, Apache or php. I then installed them manually and tried to use wamp but every time it failed to start apache. I only managed to get everything working by removing any trace of wamp.
Suspecting that it may be an issue on my machine, I tried tonight to install wamp on another machine and exactly the same thing happened. I suspect that the version of wamp I have downloaded has done something on both machines. I did a fresh download on the second machine.
I am now at a loss as to what to do next. I desparately need to get php and mysql working as this seems to be the combination that most web hosts (and cetainly mine) have installed.
I think I will try xampp to see if I have any more success.
Incidently, php performs fine on its own. It is only when I query Mysql on Apache that I get a problem.
I won't abandon this question at this stage as I appreciate very much the help that you and madaboutasp have given and would appreciate your comments on my further efforts.
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
@TrevorParnhamntl:
Okay... I would suggest XAMPP as I use it too for my local development
.. actually I never before install WAMP on my PC (just heard some good reviews about it) :-)
Years ago I tried EasyPHP and lasts for several months (which is easy to install too, like XAMPP) but after trying XAMPP I found out that it is the most user-friendly program (at least for me) and I just keep using XAMPP until today. I'm still using XP on my computer but I think they supports Vista too.

Well, let know if you're still experience problems after having XAMPP ... :)
0
 
LVL 1

Accepted Solution

by:
TrevorParnhamntl earned 0 total points
Comment Utility
Finally, I've cracked it!!! Or, should I say onemadeye, madaboutasp and me have cracked it.
I tried xampp and had exactly the same problem as with wamp.
My past experience told me to go back to the basics, so I uninstalled everything and removed all traces of php, apache, mysgl, wamp, xampp and anything else I thought I might have been using.
I then installed apache again and it refused to run. Because I had also tried to install it on a different machine, without success, I was pretty sure the issue was with Vista, particularly as onemadeye had said he was still on XP and it worked for him. My guess is that madaboutasp also is not on Vista.
One thing I picked up in my hours of trawling google was that program files is more highly protected on vista than on previous windows versions. By default apache installs into program files. That means that the localhost effectively is in that folder.
So, I tried to create links to the important apache files outside of program files. Still no luck, apache wouldn't run
At that stage I gave up for the night. The next day when I booted up, guess what? Apache was running. It needed a reboot after having made all the changes the previous night.
I then installed php followed by mysql and did all the necessary re configurations. Ran the latest code we had all put together and bingo, it produced the results of the query.
As far as I can tell, the thing that made the difference was moving the local host outside of program files. It seems it doesn't like the extra levels of security in Vista.

I'm suprised that neither the producers of wamp or xampp have picked up on this.

Anyway, I am really grateful to both of you for your help to at least ensure the script I was running was correctly formatted. The fact that you both could run it told me that wasn't the problem.
I would like to award 500 points to both of you but not sure how. Any suggestions?
0
 
LVL 5

Expert Comment

by:onemadeye
Comment Utility
Hi,
I just able to login back here today and read your response...

Well, I'm glad that finally you can solve the case.


Regards...
0
 
LVL 1

Author Closing Comment

by:TrevorParnhamntl
Comment Utility
As, I actually finally solbved the problem myself, the two experts helped me considerably and there is no doubt I wouldn't have done it with out their help, or it would have taken a long, long time. Therefore, I have split the points equally
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now