Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
Can someone tell me what is wrong with that statement cause I do not see any mistake?
$PrevReleaseModel = $con->prepare("SELECT * FROM model WHERE model_name=:model_name AND model_release:model_release");
$PrevReleaseModel->bindParam('model_name',$model_name);
$PrevReleaseModel->bindParam('model_release',$model_release);
$PrevReleaseModel->execute(array('model_name'=>$model_name,'model_release'=>$model_release));
I am really confused.
WHERE model_name=:model_name AND model_release = :model_release
You missed a equal sign in the last condition.
You may try this out:-
$PrevReleaseModel = $con->prepare('SELECT * FROM model
WHERE model_name = :model_name AND
model_releas = :model_releas'
);
$PrevReleaseModel->bindParam(':model_name', $model_name, PDO::PARAM_STR);
$PrevReleaseModel->bindParam(':model_releas', $model_release, PDO::PARAM_STR);
$PrevReleaseModel->execute();
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I'm trying to include a file to current php page but the name of the file depens on the lang.
This line does not work:
include_once PATH.'lang/'.$_SESSION['lang'].'.php';
How can I achieve that?
Your problem should be the "PATH". It must be a string to concatenate with the other strings. For example:
include_once '/sites/all/files/'.'lang/'.$_SESSION['lang'].'.php';
Also be careful with the slashes that make your path to the file.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
trying to check whether a user exists or not via pdo
$wantedusrnm = $_POST['new-usrnm'];
$userExist1 = "SELECT * FROM users WHERE username=:wantedusrnm";
$userExist = $handler->prepare($userExist1);
$userExist->execute(array(':username' => $wantedusrnm));
$userExist = ($userExist->rowCount());
for some reason it errors, dunno why, any reasons?
Change:
$userExist->execute(array(':username' => $wantedusrnm));
To:
$userExist->execute(array(':wantedusrnm' => $wantedusrnm));
Because, in your query you've got :wantedusrnm but in your execution array you've got :username.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
i tried to debug it but i really don't know what's causing the error. i already traced the missing brackets but i think there's none. so please help!
<?php
class Model_role extends CI_Model {
public function scalar($user_account, $role){
$this->db->where('login_id', $this->input->post('idnum'));
$this->db->select($role); z
$query = $this->db->get($user_account);
$row = $query->row_array();
return $row['role'];
}
}
?>
It looks like there's a stray z way to the right of $this->db->select($role); Can you search for z in your editor and see if it comes up?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I hava a problem at my PHP script!
I want to do something like
echo "hello $var";
And the output should be "hello $var". So it should not take the value of $var, but a string "$var".
I want to use this to create a php file with a php script...
Is there any way to solve this?
Thanks in advance!
Use single quotes:
echo 'hello $var';
Or escape the $:
echo "hello \$var";
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I am following video tutorials on the Internet, and this is one of them. However, I am getting a syntax error and can't find where it is.
<?php
function hesapla($ilktarih,$sontarih){
$yil=$son-$ilk;
$ay=$yil*12;
$gun=$ay*30;
return array("$ilktarih","$sontarih","$yil","$ay","$gun");
}
$ilktarih=$_POST["ilk"];
$sontarih=$_POST["ikinci"];
hesapla($ilktarih,$sontarih);
list ("$ilktarih","$sontarih",$yil,$ay,$gun)=hesapla($ilktarih,$sontarih);
?>
Remove double quotes from list variables like this :
<?php
function hesapla($ilktarih,$sontarih){
$yil=$son-$ilk;
$ay=$yil*12;
$gun=$ay*30;
return array("$ilktarih","$sontarih","$yil","$ay","$gun");
}
$ilktarih=$_POST["ilk"];
$sontarih=$_POST["ikinci"];
hesapla($ilktarih,$sontarih);
list ($ilktarih,$sontarih,$yil,$ay,$gun)=hesapla($ilktarih,$sontarih);
?>