|
That will depend on the design and implementation of your website.
|
|
|
|
|
Because the amounts are in different tables do i have to use join or inner join etc
|
|
|
|
|
It should work as I showed you; give it a try and see.
|
|
|
|
|
Hi, I am developing a Laravel app and I am trying to integrate PayPal subscriptions and I followed the instructions here and I've managed to create a product, create a plan, create a subscription and then redirect to PayPal for subscription approval, however, I can't find information on how to proceed in other words how to handle the response after PayPal redirects to my success link. I've looked at the "BASIC INTEGRATION" as well as the "FULL INTEGRATION" and the "REFERENCE" sections and can't find the information.
Any ideas where this information might be? Any tutorials, links with up-to-date info will be much appreciated.
|
|
|
|
|
i have query php like this
<?php
include('../config.php');
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
if(isset($_POST['pasar'])){
$code = $mysqli->real_escape_string($_POST['pasar']);
$queryPeriode = $mysqli->query("SELECT * FROM tb_periode WHERE code_pasaran = '".$code."' ORDER BY no DESC LIMIT 10");
$data = [];
while ($result = $queryPeriode->fetch_assoc()) {
$data[] = [
"periode" => $result['no'],
];
}
echo json_encode($data) ;
}
}
?>
my js code is like this
$("#pasaran").on('change',function(e) {
$("#periode").html("");
let code = $(this).val();
$.ajax({
method: "POST",
url: "?page=get_data_priode",
data: {pasar:code},
dataType: "json",
})
.done(function( data ) {
$.each( data, function( key, value ) {
$( "#periode" ).append("<option value="+value.periode+">"+value.periode+"</option>");
});
});
e.preventDefault();
});
the result is like this
[
0: {periode: "1521"}
1: {periode: "1520"}
2: {periode: "1519"}
3: {periode: "1518"}
4: {periode: "1517"}
5: {periode: "1516"}
6: {periode: "1515"}
7: {periode: "1514"}
8: {periode: "1513"}
9: {periode: "1512"}
]
but i want is the result after 1521 have result 1522 how can i do it? can someone teach me? how to do like that? me already tried to searching my quested in google but still no have answer
|
|
|
|
|
You need to pass the correct starting value to your SELECT clause, and get the returned values in ASCending order.
|
|
|
|
|
captan3899 wrote:
$queryPeriode = $mysqli->query("SELECT * FROM tb_periode WHERE code_pasaran = '".$code."' ORDER BY no DESC LIMIT 10"); Don't do it like that!
Your code is vulnerable to SQL Injection[^]. NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
PHP: SQL Injection - Manual[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
This is my code to connect java socket:-
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, '127.0.0.1', 12345);
while(true)
{
$line = socket_read($socket, 1024, PHP_NORMAL_READ);
var_dump($line);
$someArray = json_decode($line, true);
$otp = $someArray["otp"];
if($someArray["msg"] == "otp_generation")
{
$myObj = new \stdClass();
$myObj->msg = "OTP RECEIVED NEED TO CONNECT";
$send = json_encode($myObj);
socket_send($socket, $send, strlen($send), 0);
}
exit;
}
When connection is established successfully server send one OTP to client and received successfully in client. Then i send data to server OTP RECEIVED acknowledgement, it also received in server. After OTP RECEIVED acknowledgement server send welcome msg to client. I cant get the welcome message. if i remove the (exit) soket_write is not working i can't send data to server. if i put exit data send to server successfully and socket is closed. What can i do for this type of issue.
I don't know what mistake i done.?
|
|
|
|
|
Hi there
How to share session cookies from a PHP application with my WordPress website, hosted on the same server and the same domain?
(So users registered in that PHP application can login to WordPress without having to re-register.)
Thanks.
|
|
|
|
|
|
After many years of hosting a website on Windows Server with several Access DB's delivering cooking information via dropdown lists, I'm moving all to a Linux-Centos 6.6 VPS. They were created using Front Page but I didn't use FP Extensions just .asp. As an example see one that I need advice on--- http://www.cooksaurus.com/foodnews.asp
I know how to and have converted most the databases to MySql. I'm on a localhost test machine at the moment until all is working to my satisfaction. So with the referenced page, I'm basically trying to recreate it using PHP and HTML and have already created a page that creates a dropdown list using php and calling data from the MySql db and it works fine. Here is my humble coding, BTW I'm a chef with some novice coding knowledge.
<?php
$hostname ="127.0.0.1";
$username="root";
$dbname="newspaper";
$password="xxxxx";
$usertable="Food_Sections";
$columnname="Newspapers";
mysql_connect($hostname,$username,$password) Or die ("Unable to connect the dbase");
mysql_select_db($dbname);
$query="select * from $usertable";
$result=mysql_query($query);
?>
<html>
<head>
<center>
<h1> Dropdown List of Newspapers</h1>
<h2> DataServer</h2>
<hr/>
</head>
<body>
<select>
<option> Select Newspaper!</option>
<?php
if($result)
{
while($row=mysql_fetch_array($result))
{
$Newspapers=$row["$columnname"];
echo"<option>$Newspapers<br></option>";
}
}
?>
</select>
</center>
</body>
</html>
But now I can't figure out how to "Click" on a city's newspaper and display its hyperlink to the Food Sections website using php? (I'm trying to duplicate what already exists on the Windows .asp page with a submit button or by simply clicking on an entry and when selected a clickable hyperlink to its corresponding web page.
Any suggestions, examples of what to do or references to how to make this work would be gratefully accepted.
JJV
|
|
|
|
|
hello there,
i have index.php, input.php, inputvalidation.php and output.php
i submit info into input page, get ajax validation in inputvalidation page, and send data
to output page ,or in case of error cancel submit and you get a error message in input page
in output.php, i have this code, it enters the page but it sends me back
to index.php (validation is ok)
if (!isset($_POST['submitinput']) )
{
header("Location: index.php");
exit();
}
form in input.php
<input class="btsubmitinput" id="btsubmit_input" type="submit" name="submitinput" value="Select">';
ajax in input.php
$(document).ready(function() {
$("#form_input").submit(function(event) {
var thisForm = this;
var dur_op = [];
var dur_nr = [];
var dur_ps = [];
var act_pre = [];
for (var i = 1; i <= acts; i++)
{
dur_op[i] = $("#id_activity" + i + "durationoptimist").val();
dur_nr[i] = $("#id_activity" + i + "durationnormal").val();
dur_ps[i] = $("#id_activity" + i + "durationpessimist").val();
act_pre[i] = $("#id_activity" + i + "predecessor").val();
}
$.post("includes/inputvalidation.php", {
dop: dur_op,
dnr: dur_nr,
dps: dur_ps,
prede: act_pre
}).done(function(data) {
var result = data.substring(0, 5);
if (result == "ERROR") // result error //
{
alert(data);
}
else // result ok //
{
thisForm.submit();
}
});
event.preventDefault();
});
});
</script>
i can get ISSET() to work with other form variables so it all works fine
but i can't get the submit button "feedback" which is kind of wierd to me
thanks
|
|
|
|
|
Hi all, I'm trying to understand the following failover and clustering architecturthe, but I can not understand why on the Main server side we have 3 physicals Tomcat aplications servers and 1 physical Apache Server indicating a direct connection wiht another Apache at the Frontend? I'm confused with the architecture. Can you maybe please help me understand the infrastructure shown in att pic? Which server performs load balancing and HA?
Best regards
Apache Frontal
/ \
Apache1 Apache2
| |
TOMCAT1 TOMCAT1
| |
TOMCAT2 TOMCAT2
| |
TOMCAT3 TOMCAT3
modified 9-May-19 11:38am.
|
|
|
|
|
hi guys
<?php
$sql="SELECT * FROM users WHERE id=1";
$result=$database->query($sql);
$user_found=mysqli_fetch_array($result);
echo $user_found['user name'];
?>
and this is my database class
public function query($sql){
$result= mysqli_query($this->connection, $sql);
return $result;
}
but it isnt execute correctly
this shows me this error
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in \ on line 19
mysqli_fetch_array() expects at least 1 parameter, 0 given in \ on line 12
i dont know why? could you tell me where is the problem please?
|
|
|
|
|
This is one of the most common MySQL questions here, and the answer can be found quite easily by studying the documentation to see what values may be returned from a MySQL method call. The main issue with your code is that you are assuming that the statement $result= mysqli_query($this->connection, $sql); , will return a valid response. You must check your return values, do not assume that they return valid data.
|
|
|
|
|
$connection , it should be .
You have missed $ symbol.
|
|
|
|
|
any latest api for currency converter free
|
|
|
|
|
Please don't repost if your question does not appear immediately: all of these went to moderation and required a human being to review them for publication. In order to prevent you being kicked off as a spammer, both had to be accepted, and then I have to clean up the spares. Have a little patience, please!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
I have a webhook from fastSpring.
The webhook sends something like below and I want to know how can I create a webhook listener to use the inflammation passed by the webhook?
How can I create the listener to capture below information please?
<pre lang="text">{
"order":"yzaP3EQAQtCOBLhYP2ZN-Q",
"id":"yzaP3EQAQtCOBLhYP2ZN-Q",
"reference":"MyDomain190418-3737-54184",
"buyerReference":null,
"completed":true,
"changed":1555598658633,
"changedValue":1555598658633,
"changedInSeconds":1555598658,
"changedDisplay":"4/18/19",
"language":"en",
"live":false,
"currency":"USD",
"payoutCurrency":"USD",
"invoiceUrl":"<a href="https:
"account":{
"id":"qjY3pex6TH6rj6A2f71vVg",
"account":"qjY3pex6TH6rj6A2f71vVg",
"contact":{
"first":"Jassim",
"last":"Al Rahma",
"email":"myemail@gmail.com",
"company":null,
"phone":"123456789"
},
"language":"en",
"country":"AE",
"lookup":{
"global":"XNpsaeO3QLO906bY9HcusA"
},
"url":"<a href="https:
},
"total":29.99,
"totalDisplay":"USD 29.99",
"totalInPayoutCurrency":29.99,
"totalInPayoutCurrencyDisplay":"USD 29.99",
"tax":0.0,
"taxDisplay":"USD 0.00",
"taxInPayoutCurrency":0.0,
"taxInPayoutCurrencyDisplay":"USD 0.00",
"subtotal":29.99,
"subtotalDisplay":"USD 29.99",
"subtotalInPayoutCurrency":29.99,
"subtotalInPayoutCurrencyDisplay":"USD 29.99",
"discount":0.0,
"discountDisplay":"USD 0.00",
"discountInPayoutCurrency":0.0,
"discountInPayoutCurrencyDisplay":"USD 0.00",
"discountWithTax":0.0,
"discountWithTaxDisplay":"USD 0.00",
"discountWithTaxInPayoutCurrency":0.0,
"discountWithTaxInPayoutCurrencyDisplay":"USD 0.00",
"billDescriptor":"FS* fsprg.com",
"payment":{
"type":"test",
"cardEnding":"4242"
},
"customer":{
"first":"Jassim",
"last":"Al Rahma",
"email":"myemail@gmail.com",
"company":null,
"phone":"123456789"
},
"address":{
"country":"AE",
"display":"AE"
},
"recipients":[
{
"recipient":{
"first":"Jassim",
"last":"Al Rahma",
"email":"myemail@gmail.com",
"company":null,
"phone":"123456789",
"account":{
"id":"qjY3pex6TH6rj6A2f71vVg",
"account":"qjY3pex6TH6rj6A2f71vVg",
"contact":{
"first":"Jassim",
"last":"Al Rahma",
"email":"myemail@gmail.com",
"company":null,
"phone":"123456789"
},
"language":"en",
"country":"AE",
"lookup":{
"global":"XNpsaeO3QLO906bY9HcusA"
},
"url":"<a href="https:
},
"address":{
"country":"AE",
"display":"AE"
}
}
}
],
"notes":[
],
"items":[
{
"product":"featured-ad",
"quantity":1,
"display":"Featured Ad",
"sku":null,
"subtotal":29.99,
"subtotalDisplay":"USD 29.99",
"subtotalInPayoutCurrency":29.99,
"subtotalInPayoutCurrencyDisplay":"USD 29.99",
"discount":0.0,
"discountDisplay":"USD 0.00",
"discountInPayoutCurrency":0.0,
"discountInPayoutCurrencyDisplay":"USD 0.00",
"fulfillments":{
}
}
]
}</pre>
www.softnames.com
|
|
|
|
|
Ok. I am utterly stumped!! I have read and read about how to use MAMP and install and offline version of Wordpress. This I can do, but my goal is to have a mobile copy of my hosted website on a USB drive. I have the latest version of MAMP installed. I can get a fresh copy of wordpress to come up when I point to the htdocs folder within the application. But when I point the document root to my USB drive to look for the wordpress files, it will not read. I get the error, "cannot connect to database."
After troubleshooting for about two days, I now have the error 404 "the requested URL is not on the server". Here is my current config.
On the MAMP side. I have the document root pointing to my usb drive where my wordpress files are located.
USB/Sites/Magazine
My SQL database has been exported and imported into the MAMP myPhpAdmin page with the same database name.
I have updated the Options table for Home and Site to reflect localhost
In the wordpres file wp-config.php file I have ensured the database name is the same, and I have changed the User to root and password to root.
In spite of all this, I cannot get it to connect and load wordpress. Any Ideas recommendations would be appreciated. As I am completely stumped since I have followed the MAMP tutorial from Linked In Learning, and I have watched numerous videos on how to do this online.
I even went so far as to create my own certs for SSL. (No, it isn't even in the same ball park of a problem) . I know that now.
But what stumps me is that if I create a blank database, everything will work fine, I just cannot get an existing database to connect. Any recommendations would be really appreciated.
I'm sorry, I would have uploaded the screenshots, but it appears that I cannot upload to this forum.
|
|
|
|
|
insert into master(scheduletype,schedulename,description,starttime,nexttime,stoptime,isstop,
scheduletime,workingweekdays,interval,fromtime,totime,months, recurringday,dates,weeksequence,month_days,month_isdays,month_isweeks,active,enabled,
freefield1,freefield2,freefield3,freefield4,created_by,created_on)
values(@scheduletype,@schedulename,@description,@starttime,@nexttime,@stoptime,@isstop,
@scheduletime,@workingweekdays,@interval,@fromtime,@totime,@months, @recurringday,@dates,@weeksequence,@month_days,@month_isdays,@month_isweeks,@active,@enabled,
@freefield1,@freefield2,@freefield3,@freefield4,@OperationBy,getdate())
select @@identity
I'm new to Linq please do let me know how above query cab be written in Linq
|
|
|
|
|
It cannot. LINQ is for queries, not for inserting or updating.
|
|
|
|
|
hi guys
i wanna to update the database values with php .the code is totally true i checked it many times .but i dont know whya this shows me this error i dont know what is it for ;
error :
SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id = 6 `Email` = 'ali@test.com' , UPDATE `users` SET `Name` = 'ali85' ' at line 1
the code :
<pre><?php
if(isset($_POST['update'])){
$username=$_POST['Name'];
$password = $_POST['Password'];
$email = $_POST['Email'];
$id = $_POST['id'];
$query = "UPDATE `users` SET ";
$query .=" `Name` = '$username' , " ;
$query .= " `Password` = '$password' , ";
$query .= " `Email` = '$email' , " .
$query .= " WHERE id = $id " ;
$result = mysqli_query($connection , $query);
if(!$result){
die("Query Failed". mysqli_error($connection));
}
}
?>
help me please
|
|
|
|
|
Amir karim wrote: the code is totally true i checked it many times Not very thoroughly checked...
Amir karim wrote: $query .= " `Email` = '$email' , " .
What do you think that . is going to do? Certainly not what a ; would do.
And when you've cleaned that up, you'd better read up on SQL injection before your database is trashed by Little Bobby Tables.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|