|
piano0011 wrote: tutorial by passive income Assuming you are referring to a CodeProject article, then you should use the forum at the end of the article.
|
|
|
|
|
<pre>I have a folder which has both .HTML and .php files. By default, the .HTML file is loading as expected and also if i click a link to a .php, it will not load the .php file of WordPress. It redirects to the .HTML file again .
Condition:
This is a word press site
As the default, I need to run .html
If I click the link to the .php file it will go running WordPress
Please, anyone, guide me to write a .htaccess file to do that.
What I have tried:
i have intro.html and wordpress files in the same folder. by default intro.html would run then i click index.php, the wordpress will run. </pre>
|
|
|
|
|
|
Hey guys!
I tried to set my timestamp to undefined as 0 and for some of my other tables, this is working but not for others.. Is it possible to do this? I even tried to do something like this in my php code: $date = 0; but that doesn't work all the time...
|
|
|
|
|
hey guys!
I am just wondering, how do I go about in selecting from two tables without joining? Is this possible? I tried to use left join but keep getting sql failed....
|
|
|
|
|
According to the php manual, I should use the mysqli_store_result()first before calling the mysqli_stmt_num_rows, whereas from my experience, I can always use mysqli_num_rows to check if the row exists?
|
|
|
|
|
The mysqli_stmt_num_rows() function accepts a statement object as a parameter and returns the number of rows in the result set of the given statement.
The mysqli_num_rows() function is an inbuilt function in PHP which is used to return the number of rows present in the result set.
|
|
|
|
|
I have read that in order to use mysqli_stmt_fetch, you must use mysqli_stmt_store() first otherwise it won't work, is this correct? I have always been using mysqli_stmt_get_result... I have read the php manual but it sounds almost the same to me except that for the mysqli_stmt_fetch(), you must bind the result first?
|
|
|
|
|
Please how can I use $_SERVER['PHP_SELF'] code to save record and print
simultaneouly using PHP. I need the data been submitted into the database to print on the POS printer. See form action used below. Please assist.
<form method="post" name="form1" action="<?php echo $editFormAction; ?> target="_parent">
|
|
|
|
|
Hi guys
Im struggling with something small. i am watching tutorials on PHP and MYSQL but since the video and now SQL syntax changed.
please check my query if the syntax is correct, it worked fine until i inserted my variable $uh.... not sure if im missing quotes or something.
any help will be appreciated.
Unhealthy
Healthy
';
}
}
}
}
?>
|
|
|
|
|
Your question is meanwhile 10 days old but this might still help.
Quote: i am watching tutorials on PHP and MYSQL but since the video and now SQL syntax changed Don't use videos for learning programming. Most of them are of poor quality and some are telling you even wrong. Use books or web tutorials and read the official documentation for the used languages and functions (PHP: PHP Manual - Manual[^] and the documentation of the used database).
$uh=strtolower($_GET['uh']);
if($uh=='u'||$uh=='h'){ Never use == for string comparison. Use === or PHP: strcmp - Manual[^] to check for identity to avoid type juggling (see PHP: Comparison Operators - Manual[^]).
Always check for error return values and print error messages. This is especially useful with mysqli functions during development because you will get meaningful database error messages that help you finding syntax error in SQL query strings:
if ($result=mysqli_query($link, $sql)) {
if (mysqli_num_rows($result)) {
}
else {
echo 'no results';
}
}
else {
printf("SQL error: %s\n", mysqli_error($link));
}
Because $uh is a string and the healthy_unhealthy field probably too or a single character, you should enclose the value in single quotes in the query string:
$sql = "SELECT food,calories FROM food WHERE healthy_unhealthy = '". $uh . '" ORDER by id";
|
|
|
|
|
You should also escape variable
$_GET - security...
|
|
|
|
|
i am working on php and want to add accordian on every row in that dyanamic data is there but as i add accordian it always showing at tne end of all the rows
|
|
|
|
|
With ?php echo $editFormAction/ $_SERVER['PHP_SELF'] as form action, how can I access the data entered in a form textbox but not submitted into db from another pop up window
|
|
|
|
|
Let us assume that we have the following form.
<?php
echo '<form name="signUpForm1" method="POST" action="'.$_SERVER["PHP_SELF"].'">";
<input name="field1" type="textbox"></input> <?php /* lets say field1 value is "John" */
<input name="field2" type="textbox"></input> /* Lets say field2 value is "Doe" */
</form>
?>
and you wish to use the values from signUpForm1 in signUpForm2. much like below
<form name="signUpForm2">
<?php echo "Welcome ".$_POST[field1]." ".$_POST[field2];
$Username=$_POST[field1]." ".$_POST[field2];
?>
<input type="textbox" name="User Name" value="<?php echo $Username;?>">
While I admit there may be some syntax errors with double and/single quotes, it should basically demonstrate the basic idea.
Just a note, if you use method="GET" then use
$_GET['field1'] or
$_GET['field2']
|
|
|
|
|
Hello,I am new developer which uses php codeigniter. I got barcode generator code in core php but didn't able to convert that code into php codeigniter. So please help me .about it.
|
|
|
|
|
You can use composer and https://github.com/picqer/php-barcode-generator
|
|
|
|
|
I need to print a form data on another page. But the page been referenced opened a normal window. I want the window to appear in a smaller dimension to enable me print result to a POS printer.
This is the code I used on the onCLick Button attributes. Please any idea will be appreciated. Thanks
|
|
|
|
|
I have a form that submits data into my MySql database using the
php $_SERVER['PHP_SELF']
But I want to be able to view the contents of the data entered prior to submission on another page. Using this code
<input type= button name="Print receipt" onClick=window.open("print_process_script.php","width=550,height=300,left=150,top=200,toolbar=0,") value="Print Reciept" />
It opens another page but does not show the data entered just the Caption for the textbox only.
Please assist.
|
|
|
|
|
Please I need help on how to use 4 digit format as incremental value using PHP. the cod below I used displays incremetally but it only in 1,2,3 instead of 001,002,003.
What is wrong with m code?
$query = "Select Max(Serial_Number) From captain_order";
$returnD = mysql_query($query);
$result = mysql_fetch_assoc($returnD);
Print mysql_error();
$maxRows = $result['Max(Serial_Number)'];
if(empty($maxRows)){
$lastRow = $maxRows = 1;
}else{
$lastRow = $maxRows + 0001 ;
}
|
|
|
|
|
Computers don't know about leading zeroes. That is just a form of representing numbers to humans (being shown on screen, printed, or even written on a piece of paper).
So just use
$lastRow = $maxRows + 1; If you want to show the number with leading zeroes, use a corresponding formatting function like PHP: sprintf - Manual[^]:
echo sprintf("%03d", $lastRow);
|
|
|
|
|
|
How to use PHP global processing script action to process sumbitted data and display form data entered on the text on another page . Please provide an easy way out of this. Thanks
|
|
|
|
|
|
Please I need a guide on how to use a php $_SERVER['PHP_SELF'] to insert form data into Mysql database and redisplay data entered on another form.
My form action is <pre><form method="post" name="form1" action="<?php echo $editFormAction; ?>
While the print button should be able to open another page with contents of the main form on it. I used this
<input name="Print receipt" type= "button" onclick = "Openform();" value="Print reciept" /></td> Please assist
|
|
|
|