|
What does the error message you got from mysql_error() say?
If you converted the outer quotes to double-quotes, did you then single-quote the values in the query?
|
|
|
|
|
thanks soo much for your help graham..... i got it now. Thanks
|
|
|
|
|
Transactions ID and Quantity is working! But tax, shipping and Revenue not working!
This is my php code:
<?php
$gaorder="<script type='text/javascript'> ";
$gaorder=$gaorder."var _gaq = _gaq || []; ";
$gaorder=$gaorder."_gaq.push(['_setAccount', 'UA-32542684-1']); ";
$gaorder=$gaorder."_gaq.push(['_trackPageview']); ";
$tax=($totalCost/100)*5;
$gaorder=$gaorder."_gaq.push(['_addTran','".$code_order."','haxata.com','".$totalCost."','".$tax."','0','ThanhPho','Tinh','VietNam']); ";
global $db;
$db->getConnect();
while($row = mysql_fetch_array($result))
{
$gaorder=$gaorder."_gaq.push(['_addItem','".$code_order."','".$row[Product]."','".$row[Name]."','".$row[Name]."','".$row[Cost]."','".$row[Number]."']); ";
}
$db->closeConnect();
$gaorder=$gaorder."_gaq.push(['_trackTrans']); ";
$gaorder=$gaorder."(function() {";
$gaorder=$gaorder."var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ";
$gaorder=$gaorder."ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';";
$gaorder=$gaorder."var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);";
$gaorder=$gaorder."})();";
$gaorder=$gaorder."</script>";
echo $gaorder;
?>
Please help me! thank you so much!
|
|
|
|
|
I would like to get the sum of all the fields in columns. where columns are dynamic even the rows are dynamic.
Hi here in my table the user can add column's dynamically, so i won't be knowing the columns name to raw code initially as $row['SUM(price)']. Hence I need a query which can pull by itself all the column values
|
|
|
|
|
Even if you don't know how many column and how many rows are there going to be even though you can establish certain rule. Try to establish the rule. and you can browse all row and column through javascript
I wish I could believe there is an after life.
|
|
|
|
|
how to implement like this:
$classname = "dsa";$ob = new $classname();
i just have a var of the class name and how to new the class?
|
|
|
|
|
You have the right syntax for doing that in your example.
There are some helpful functions for working with classes: Class functions[^].
The class_exists[^] function is useful for checking if you have a valid class name.
|
|
|
|
|
|
Hello masters of web developing. I have an average experience in C# and I like to know that how much does it take to be a great developer in PHP by considering that I put my time on this 24/7. Why I didn't choose ASP.NET is that I think it is much time consuming than learning PHP and I like to work with current famous CMSes like Wordpress and Drupal.
|
|
|
|
|
How long is a piece of string?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Tie both ends together and ask again!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
In my php file called "account.php" I have
<html>
<body>
<link rel="icon" type="image/gif" href="favicon.gif" />
<div id="main-box">
<ul>
<li class="buttons">
="button"="account"="Get Your Account"="#"
</li>
</ul>
</div>
</body>
</html>
I want it so when the user clicks the button, a text box appears and displays ONE line from the text file and when they view it, it deletes it from the text file.
text.txt
Eddie
Apples
Hello
People
So after the user clicks the button it displays "Eddie" line to them and then deletes it after the user sees it so that the next line "Apples" would then become the first line.
If you don't understand my question then please let me know and I will try to explain further. Thank you. 
|
|
|
|
|
|
Hi,
I have a table fetched using ajax, according to the choice made from my dropdown menu. In the table I have some input fields. I need to save my inputs in the table while submitting it.
If I check the source code of the page I cannot find the table fields to post using $_post since ajax is used. I am really new to ajax. Can anybody please tell me how I can submit these table input values in PHP?
Thanks in advance
|
|
|
|
|
I want to make a messageboard with php.
but I cant't insert data to database.
I dont know what's wrong in my code???
Can someone help me please?
<!DOCTYPE HTML>
<html>
<head>
<title> 留言板 </title>
</head>
<body>
<form action="insert.php" method="get">
請輸入名稱: <input type="text" name="name" />
請輸入標題: <input type="text" name="title" />
請輸入留言: <input type="text" name="message" />
請輸入電子郵件: <input type="text" name="email" />
<input type="submit" value="送出留言" name="post" />
</form>
</body>
</html>
<?php
require_once("connectdb.php");
if(isset($_GET["name"])!=""){
$query_insert = "INSERT INTO '1100108128'.'MB'
('USER','TITLE','MESSAGE','TIME','EMAIL')
VALUES (";$query_insert .= "'".$_GET["name"]."',";
$query_insert .= "'".$_GET["title"]."',";
$query_insert .= "'".$_GET["message"]."',";
$query_insert .= "NOW(),";
$query_insert .= "'".$_GET["email"]."')";
mysql_query($query_insert);
header("Location:Messageboard.php");
}
?>
|
|
|
|
|
replace
mysql_query($query_insert);
with
mysql_query($query_insert) or die('Error occured: ' . mysql_error());
Than reply with the output.
|
|
|
|
|
navigate data from database in webpage without page refresh
|
|
|
|
|
I make a little login example...
In the index.php :
<html>
<head>
<!--
</head>
<body>
Username:<input id="input-username" type="text" maxlength="100" />
Password:<input id="input-password" type="password" maxlength="16" />
<input id="btn-ok" type="button" value="OK" />
</body>
<script type="text/javascript">
$('#btn-ok').click(function() {
var DataToSend = new Object();
DataToSend.username = $('#input-username').val();
DataToSend.password = $('#input-password').val();
$.post('validate.php',DataToSend,function(data) {
if(data == 'ok')
alert('Login OK!');
else
alert('Login ERROR!');
});
});
</script>
</html>
You just make a post to a php file "validate.php" and there you validate the login, and make querys to the DataBase and return a value, and you are doing that all without refresh the page!
Any question, add me on gtalk: miguel.poegel@pears.fr
Regards,
KZ
|
|
|
|
|
ques 1: Php how can Multiple selected List box items move from one list box to another list box?
ques 2:Instead of Submit button how can i use Button or Any thing which do process like insert / update / delete /select without refresh the page?
navigate the data without page refresh how can i achieve in easy way?
|
|
|
|
|
You can use javascript... without refresh the page...
|
|
|
|
|
hi all.
I want get data form url when use header('location:'.$url) then it rederect to another url.
how to get data when using header('location:'.$url) ???
thanks
nothing
|
|
|
|
|
In one page you use:
header('Location: ' . $url);
Suppose $url = 'www.example.com/abcd.php?action=register';
And in the "abcd.php" page just do a $_GET['action'] to get the action!
And then you do something, in this case you show a div to register!
Hope I can help,
KZ
|
|
|
|
|
what about using :
$content = include '${url}';header("location:antoher url");
|
|
|
|
|
From where to start programming on Open Source?
|
|
|
|
|
From your posting in a thread below, you are at the beginner level in the learning phase. It will take you quite a while before you become competent. I would suggest you grab hold of this book and work through it doing some of the exercises.
Beginning PHP and MySQL: From Novice to Professional by W. Jason Gilmore
You could also visit the nettuts website, search for beginning php, and view their video tutorials.
When you feel you have reached some maturity in this PHP/MySQL subject, go look at, for example, SourceForge[^] who have a number of Open Source projects under some level of development.
modified 1-Aug-19 21:02pm.
|
|
|
|