What is SqlDataAdapter in dot Net?
SqlDataAdapter class belongs to the System.Data.SqlCient namespace. It provides a set of data commands to fill a dataset from results returned during a SQL query.
Why you need wamp server to run php file on web browser?
PHP Web Development and Running PHP application requires a lots of efforts and tools. For running PHP file on web browser we required a compiler which can convert php files to HTML files. And a web server like Wamp helps a php file to convert it to PHP.
Basic Component of WAMP Server are :
Wnodows : Which is our OS.
Apache : Web server for responding with web pages.
MySql : Databases Query
and PHP
What are the basic ideas of php?
The basic idea of php is to create a dynamic or database driven website. You can do many things with php... Some of the more popular are: eCommerce (online shopping cart), creating web based services, etc...
Why can a CSS sheet fail to work properly after converting a web page from HTML to PHP?
Examine the page source from the browser window for both versions and compare them closely. The PHP version must reference the CSS file correctly in the header. Check that in particular. :]
How can you use a JavaScript variable in the PHP isset function?
You can't actually do that. There is no direct way to make JavaScript code talk to PHP code, as the two languages are interpreted in different locations. The PHP is interpreted by the server, and the JavaScript is interpreted by the client. This means it's easy enough to transfer data from PHP to JavaScript (by generating the JavaScript with the PHP), but not the other way around.
If you're simply looking for a way to see if a JavaScript variable is set (from within the JavaScript itself), that can be done with a line like this one:
if(myVariable !== undefined){ /* do stuff */}
If you actually want to handle it on the PHP side, one way to do so would be to use additional PHP code when that happens. For example:
<?php
$jsVars = array();
?>
<script type="text/javascript">
var foo = 'bar'; <?php $jsVars['foo'] = 'bar';?>
var yub = 'nub'; <?php $jsVars['yub'] = 'nub';?>
</script>
... You can then check to see whether a certain variable has been set by seeing if it's in that array:
<?php
function jsIsset($varname){
global $jsVars;
return array_key_exists($varname, $jsVars);
}
?>
This however, only works when the JavaScript is generated, not when it's interpreted by the client system. For example, imagine you have a variable that is defined by a JavaScript function that is called from an onclick event. By the time that event happens, the page has already been served and the PHP is done executing.
If you want the JavaScript to tell the PHP that a variable is defined, you would need to do it through an AJAX request, which I believe is beyond the scope of this question.
C program for worst fit algorithm?
#include<iostream.h>
#include<conio.h>
#include<string.h>
int main()
{
unsigned int n,j,i,size[10],m,x=0,t;
int cho=1,ch;
system("cls");
cout<<"\t\t STORAGE PLACEMENT STRATEGIES\n";
cout<<"\tEnter the number of holes:";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"\n Enter The Size Of Hole "<<i<<":";
cin>>size[i];
}
while(cho==1)
{
cout<<"\nEnter the size of the incoming program:";
cin>>m;
cout<<"\nMenu";
cout<<"\n1.First Fit Strategy \n2.Best Fit Strategy";
cout<<"\n Enter your choice:";
cin>>ch;
x=0;
switch(ch)
{
case 1:
for(i=1;i<=n;i++)
{
if(size[i]>=m)
{
cout<<"\nYour program is placed in hole "<<i;
size[i]-=m;
x=i;
break;
}
}
if(x==0)
cout<<"There is no room for your program.";
break;
case 2:
unsigned int temp=0,pos=0,t1;
if(m<=size[1])
{
temp=size[1]-m;
pos=1;
}
else
temp=size[1];
for(i=2;i<=n;i++)
{
if(m<=size[i])
{
t1=size[i]-m;
if(temp>=t1)
{
temp=t1;
pos=i;
}
}
else temp=size[i];
}
if(pos==0)
cout<<"There is no room for your page.";
else
{
size[pos]=size[pos]-m;
cout<<"Your program is palced in hole "<<pos;
}
break;
case 4:
return;
}
cout<<"\nFree Storage List";
for(i=1;i<=n;i++)
cout<<"\nHole "<<i<<"\t\t"<<size[i];
cout<<"\n\nPress 1 to continue:";
cin>>cho;
}
}
How do you place a call to a command line executable within a PHP script?
Use the "system" function: system("Command.exe"); (See: php.net/system)
Where do scripts on my computer come from?
Scripts are coming from server.In the HTML code we include all scripts paths.so at the time of downloading the page all these scripts download and store in the cache.
What causes error code p0400 in Mazda 1996 protege?
Trouble code P0400 means:Exhaust gas recirculation-flow malfunction
Difference between event driven and procedural programming?
object oriented programming focuses on performing actions and manipulation of data that is encapsulated in objects within a sequential series of steps while event driven is more dynamic and relies on event triggering and event handling to determine the sequencing of the program.
Difference between signed number from unsigned number?
a signed number is one that can be negative (have a sign) whereas an unsigned number will only be positive. due to less information, you can double the largest number storable in a signed integer to get the data available in an unsigned integer. However, PHP doesn't have unsigned integers, they're all signed.
How can you fetch from php rather than java and net?
I am not aware of JAVA to that scale but if you just want to fetch data from mysql then PHP is just 2 statements:
Compared to .NET basic queries related to database are a lot simpler in PHP
A memory leaks can occur in a computer when a program on one's computer improperly manages the computer's memory allocations. This may happen when a object is stored but cannot be accessed by a running code.
Can you gather all form input fields with one php function or POST call?
You can access all fields posted in the $_POST array. For example, if you have a form like this:
<input type="text" name="foo"></input>
<input type="text" name="bar"></input>
You can get their values by referring to $_POST['foo'] and $_POST['bar'].
How do you post the data from an input type checkbox in a form to MySQL tables using PHP?
using the post command.$_POST['checkboxname'];
How is PHP code designated in a webpage?
PHP code is never executed by the web browser, and the source code of a PHP file will normally not be sent to the browser at all. In this sense, there is no designation of PHP code on the client's side-- it all appears to be HTML, text, XML, or whatever other type of output you choose to produce. On the server side, PHP scripts are inside of files ending in ".php". Script inside of these PHP files start with and end with ?>. Anything outside of these tags will be sent to the browser as static ("unchanging") output. The code inside the PHP tags start from the top, and are executed sequentially from top to bottom, unless flow control is used to modify the control of the scripts (such as functions, while loops, switch and if constructs, etc).
How do you retrieve the current date and time in PHP?
By calling time() you can get the current system time as a UNIX timestamp (that is, measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)).
The usual time zone and minute length complications apply.
If you need to, you can format this into a string of text (will be understandable for humans using the Gregorian solar calendar) by calling date(...) with some useful parameters. For example:
date("r", time()) will return a string in RFC2822 format, as used by E-Mail, denoting the current system time.
date("c", time()) will return a string in ISO8601 format, as used by most database management systems for date display and input, denoting the current system time.
There are all kinds of extra formats, see
Can you check symbols like star dot in MySQL database using PHP?
It is unclear what you are asking. If you want to know if you can simulate the regex ".*" behavior in MySQL, you can do so by using LIKE instead of = on the text field and using the percent sign "%" to essentially mean the same thing as .*. Something such as SELECT * FROM user WHERE username LIKE "%eri%"; would select erik, eric, erin, derik and others
How can you provide full access to some of your files while giving read-only access to other files?
In PHP you would need to change the file permissions using the function chmod().
Why php Echo not printing output with parenthesis?
echo will not return output when using parenthesis because echo is not a function like print. echo is a language construct. The benefit to using echo over the print function is speed, plus you can separate data types using comma's rather than periods.
Example:
echo 'This is a string ' , $variable , ' ending string';
is the same (but faster) as:
print('This is a sting' . $variable . ' ending string');
How much storage data exists today in characters or bytes?
It is impossible to conjure an accurate number. However, an assumption was made with the Digital Universe Study found in the related link, stating there were an estimated 1.8 Billion Terabytes in existence.
Is it possible to validate an email in PHP?
The PHP filter "validate_email" provides an easy, simple way to determine if a string is an email or not. You'll want to use the filter with a function such as filter_var(). For example: ---- $email = "someone@example.com"; $filterResult = filter_var($email, FILTER_VALIDATE_EMAIL) if ($filterResult) { echo "E-mail is valid!"; } else { echo "E-mail is not valid!"; } ---- There are alternatives to using the PHP filter, if you would like to be completely sure about what you're checking - and know how it's checked. A longer, laid out example: ---- function checkmail($mail) { $mReturn = FALSE; // Get the host / domain information of the address (and validate its existence) $email_host = explode("@", $mail);
$email_host = $email_host['1'];
$email_resolved = gethostbyname($email_host); // Check the syntax of the address if ($email_resolved != $email_host && eregi("^[0-9a-z]([-_.~]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$mail))
{
$mReturn = TRUE;
} // Return whether the domain exists, and the E-mail is valid (TRUE or FALSE) return $mReturn; } $mail = example@example.com; $result = checkMail($mail); if ($result) {
echo "E-mail is valid!";
} else {
echo "E-mail is not valid!";
} ---- After you have validated if the URL of the address is valid, you should actually check whether it exists. There is no way to check if an E-mail was sent properly in PHP as of yet - however, you can send an E-mail with an "activation link" in it to properly identify if the E-mail is working and exists. The activation link should lead to an activation page, which checks GET variables (propagated in the URL), and then checks if those variables are equal to the real activation code - saved on your server (or otherwise).
Rasmus Lerdorf, a Danish-Canadian born in Greenland, wrote the first version of PHP. He released it in 1995.