$stmt = $conn->prepare("SELECT * FROM users WHERE username = $username");
$stmt = $conn->prepare("SELECT * FROM users WHERE username = $username");
I am not sure, but can you try that query withou colon (:). I mean remove colon from begning of $username in query string.
so you typing ID In search box right?
I know what to post and when to post. I have not written any code for him. He is already doing. I have guided him what he is missing.
Pritaeas means some newbie looking for complete system without any efforts, like they say how to write query, how to develop library system.
Pritaeas expect them to start and put some efforts, on which we can further help newbies.
Have you read my reply above
I am adding 4 lines following line between line 11 and 14 in your update_success.php before update query, you do same
mysql_select_db("$db_name")or die("cannot select DB");
$titel=$_POST['titel'];
$ingrediens=$_POST['ingrediens'];
$pris=$_POST['pris'];
$id=$_POST['id'];
$sql="UPDATE pizza_menu SET titel='$titel', ingrediens='$ingrediens', pris='$pris' WHERE id='$id'";
$result=mysql_query($sql);
what you type in search box, do you type id say 1 or 2 or 3
or
you type description like computer, mouse, keybard
I ADDED single quote after res in get
$query = mysqli_query($con, "SELECT id,price FROM edit WHERE id='{$_GET['res']}' ORDER BY id ");
"SELECT id,price FROM edit WHERE id='{$_GET['res]}' ORDER BY id DESC"
order by must come after where clause
First of all you must fix search text box name to something (dont use dollor sign)
line 2 in index.php must look like (without dollor in name)
<label>Search For: </label><input type="text" name="res" />
in search.php, you query is failing becaseu i guess you using res word in query, it shold loook like following
line 6 in search.php
"SELECT id,price FROM edit ORDER BY id DESC WHERE id='{$_GET['res]}'"
post here sturcture of all table related to your qery
then post sample data here and then tell us what output u expect from that sample data.
is your post handler page is same or anohther?
I think it may be asking for primary key of the table, then you have to select text search column.
I dont think full text will expect unique value in search column
Yes it has good features, just explore it.
EXPLORE FULL TEXT SEARCH IN MSSQL
close this thread and mark it solved, then open new thread with title payroll, so other payroll masters helps you.
I added line at line between 58 and 59 like following, copy that output of query, run that in phpmyadmin directly
$query_Recordset1 = sprintf("select * from Item where ItemID=%i",$_GET['id']);
echo $query_Recordset1;
$Recordset1 = mysql_query($query_Recordset1, $con) or die(mysql_error());
select 'FHMS' + max(SUBSTRING ( employeeId ,5 , 5 ))+1 as nextkey from employeemaster
I hope This is the query you are looking for
$categories = $get_categories();
include("../view/product_list.php");
you can see two lines in index.php
here you set categories first and then include productList.php,
so here you using categories array in productlist.
if you run http://servername/view/product_list.php directly in browser then it will not display anything
See function for attaching file. Also take care to save generated file in folder with 777 permission. then use that file to attach, i set path ../pdf/mail_attach.
<?php
function attach_file($files,$mime_boundary)
{
// preparing attachments
$message="";
$filecount= count($files);
for($x=0;$x<$filecount;$x++)
{
$filefullpath="../pdf/mail_attach/".$files[$x]['file_name'];
$file = fopen($filefullpath,"rb");
$data = fread($file,filesize($filefullpath));
fclose($file);
$data = chunk_split(base64_encode($data));
$message .= "Content-Type: \"".$files[$x]['file_type']."\";\n" . " name=\"".$files[$x]['file_title']."\"\n" .
"Content-Disposition: attachment;\n" . " filename=\"".$files[$x]['file_title']."\"\n" .
"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
if($x<$filecount-1)
$message .= "--{$mime_boundary}\n";
}
return $message;
}
$html2pdf->Output("../pdf/mail_attach/".$surname.'.pdf','F');
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$files[0]['file_name']="aaa.pdf"; //filename
$files[0]['file_title']="UserFileAAA"; // file title
$files[0]['file_type']="application/pdf"; // mime file type
// Add the headers for a file attachment
$headers ="From: {$fromemailid}\n";
// $headers .="Return-path: {$fromemailid}\n";
$headers .= "MIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$subject = $db_broad[$bindex]['mail_subject'];
//$message ="This is a multi-part message in MIME format.\n\n";
$message ="--{$mime_boundary}\n";
$message .="Content-type: text/html; charset=iso-8859-1\n";
$message .="Content-Transfer-Encoding: 7bit\n\n" ;
$email_text=$message;
$message .=$email_text."\n\n";
$attachment=attach_file($files,$mime_boundary);
if($attachment!="")
$message .="--{$mime_boundary}\n".$attachment;
$sendmail = mail($toemailid ,$subject,$message,$headers,"-f".$fromemailid);
?>
I put line 8 [calling mail()] at the end, becaseu you can not call mail function before setting other parameters.
<?php
$fn = $_POST['fn'];
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
$to = "gmail@gmail.com";
$subject = "Form Submission";
$headers = "From: " . strip_tags($_POST["req-email"]) . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST["req-email"]) . "\r\n";
$headers .= "CC: gmail@yahoo.com.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content=Type: text/html; charset=ISO-8859-1\r\n";
$message = "<html><head>";
$message = "<style>";
$message = "h1 {color:#blue;}";
$message = "table {border:1px solid black;}";
$message = "</style></head><body>";
$message = "<h1>Hello, this form has been submitted!</h1>";
$message .= '<img src= "logo.png" />';
$message .= '<table rules="all" style="border-color: #ffb300;" cellpadding="10">';
$message .= '<tr style="background: #ffb300;"><td><strong>Name:</strong> </td><td>' . strip_tags($_POST['req-name']) . '</td></tr>';
$message .= '<tr><td><strong>Email:</strong> </td><td>' . strip_tags($_POST['req-email']) . '</td></tr>';
$message .= '<tr><td><strong>Phone:</strong> </td><td>' . strip_tags($_POST['req-phone']) . '</td></tr>';
$message .= '<tr><td><strong>Comments:</strong> </td><td>' .strip_tags($_POST['comments']) . '</td></tr>';
$message .= "</table>";
$message .= "</body></html>";
mail($to, $subject, $message, $headers);
?>
this code list cateries, with link
when user clicks that link, then new page will open shwoing the prodcuts of the clicked categories
if you say its not working, what does it mean.
yOu get error, or you get some different output or what happening, tell exactly.
afte foreach statment you must use curly braces to cover all below code, right now
$query="select * from wed_sweets"; statement will be called in loop.
<?php
mysql_connect("localhost","root","")or die(mysql_error());
//echo"connection with mysql";
mysql_select_db("cater") or die(mysql_error());
//echo"database cater connected";
foreach ($_POST['check'] as $k=>$c)
{ //i added this brace
$query="select * from wed_sweets";
$result=mysql_query($query) or die(mysql_error());
if($_POST['submit']=='submit')
{
{
if($c=='on')
{
while($k=mysql_fetch_array($result))
{
echo"$row[FName] "."$row[LName]";
echo "$row[item_name]"."$row[price]";
}
}
}
}
} //i added this brace
?>
You can use functions to solve your purpose
function progA
{
.
.
.
}
function progB
{
.
.
progA();
.
}
HOw many times player will bet?
you can keep track using multi dimentional array for each bet
that each parent array element will keep track of each bet (in another array)
so at end we can sum up array values to know win/lose or profit/loss
On selection of game or app, If you want to update file on server, you must submit your page using post method or you can use jquery. But simple javascript can not update file on server.
nobody can solve it, until you post your concern code
$query="update applicants set applicants.reviewedby = CONCAT(ifnull(applicants.reviewedby,''),".$_SESSION['user_id'].") where user_id={$_GET['uid']}";
first joins are fine then runing 3 times query
you must select col names youwant in select statment to avoid duplicat columsn
SELECT launh.name as lname, ......... FROM launch
then instead of col index , use column name
echo $row['lname'];
I made one change. just added strtolower function to extension
$extension = strtolower(end(explode(".", $_FILES["uploadedfile"]["name"])));
and with <20000, you can upload file upto size of 20 KB ONLY, bigger file then 20kb will not upload.
Your code is fine
only problem with conditon on line 15 above
($_FILES["uploadedfile"]["size"] < 20000)
this says your file must be bigger then 20000 bytes, if you try file smaller then this size it will not upload.
where it stucks?
do you have write permission to upload folder?
post samle file data
and your php code
this happnes, when your server has limit of some filesize, you can see in php.ini, for paramater related to file upload, you need to increase that sizes
use declare work after begin
CREATE PROCEDURE sp1 (x VARCHAR(5))
BEGIN
DECLARE xname VARCHAR(5) DEFAULT 'bob';
DECLARE newname VARCHAR(5);
DECLARE xid INT;
SELECT xname,id INTO newname,xid
FROM table1 WHERE xname = xname;
SELECT newname;
END;
try this
$arr = mysql_fetch_array($sql);
while($previous = mysql_fetch_array($sql))
{
if(!is_null($previous) && $previous['euro'] == $arr['euro'])
{
$euro = '';
$usd = '';
}
else
{
$euro = $previous['euro']-$arr['euro'];
$usd = $previous['usd']-$arr['usd'];
$huf = $previous['huf']-$arr['huf'];
if('-'.$arr['euro'] == $euro)
{
$euro_ok = null;
$usd_ok = null;
$huf_ok = null;
}
else
{
$euro_ok = $euro;
$usd_ok = $usd;
$huf_ok = $huf;
}
$data .= '<tr><td style="width: 100px; background-color: #CCC;">'.date("d-M-Y", strtotime($arr['data'])).'</td><td>'.$arr['euro'].'</td><td>'.$this->formatare($euro_ok).'</td><td>'.$arr['usd'].'</td><td>'.$this->formatare($usd_ok).'</td><td>'.$arr['huf'].'</td><td>'.$this->formatare($huf_ok).'</td></tr>';
}
$arr=$previous;
$i++;
}
try this, add 1 lines before while
$previous = mysql_fetch_array($sql)
while($arr = mysql_fetch_array($sql))
{
for first case your previous element is blank, you are setting it at line 30. So you must have some reference value in the begingin for $previous
actully what i did was once user login we get user_id, and then it is not to be passed, we are again running second query to fetch user_level
this is strange because your all pages working fine here even it is loading user_level in session also. Only way left is to look at your pc to solve.
I have removed this line from query in login_check
COUNT(user_id
) as count
,
I found this query was not running, so your login_check must look like this as below
function login_check($email, $password){
$email = mysql_real_escape_string($email);
$login_query = mysql_query("SELECT `user_id` FROM `users` WHERE `email`='$email' AND `password`='".md5($password)."'");
return (mysql_result($login_query, 0) == 1) ? mysql_result($login_query, 0, 'user_id') : false;
}
also send code for init.php, header.php and footer.php
send full script of pages you used to login and next page wher you wnat user_levle and also again send ddatbase script. and some sample data sql
i think you need loop in loop
first run that your query
then in that loop run query in second loop
from response_tb where all_id =first loop all_id
that is the spelling in the table script you posted. have you try to run that query in phpmyadmin?
what you return you are not passing back to calling function
if ($position < $width - 1)
check($width, $position + 1, $base_string . $charSet[$i], $charSet);
You must store output of check(...)function to some array, so you are looing your processsed output here.
if ($position < $width - 1)
$retcomb=check($width, $position + 1, $base_string . $charSet[$i], $charSet);
you expecting us to solve everything for you. You can check that query syntax, see where is the problem, what is spelling of your user_level column
I am again adding 2 new lines after 38 in your login.php
$_SESSION['user_id'] = $login;
$query = mysql_query("SELECT user_level FROM `users` WHERE user_id =".$_SESSION['user_id']) or die(mysql_error());
$query_result = mysql_fetch_assoc($query);
$_SESSION['user_level']=$query_result['user_level'];