I am setting up a basic shopping cart and at present I have the folowing code to store the product_id and quantity of those items which the customer has added to the basket:
$product_details = array("qty" => $quantity, "productID" => $product_id);
if(isset($_SESSION['cart'][$product_id]))
{...
I have the following line of code:
include ('Location: description.php?prod_id=$product_id');
but I receive the error:
Warning: main(Location: description.php?prod_id=$product_id): failed to open stream: No such file or directory
I think it is obvious to see what I am trying to do - open a...
I have hit a snag with my site and hope someone can help.
I have a page comprised of three frames:
-------------
| Header |
-------------
| MainFrame |
-------------
| Footer |
-------------
The contents of mainframe is generated dynamically. This has all been working fine, however...
I have the following query:
$sql = "SELECT product_name FROM products,product_brand_category WHERE products.product_id = product_brand_category.product_id AND brand_id='9' AND category_id='5'";
$result = mysql_query($sql)
or die ("Could not execute query" . mysql_error());
while ($row =...
Hi,
This is my first real project using mysql and PHP and would like some help creating a query please.
I have two tables:
Table 1 [product_id, product_desc, product_cost]
Table 2 [brand_id, category_id, product_id]
What I want to do is search table 2 for entries where the brand_id and...
I hope this will be a basic question for some of you – it’s my first major PHP project and I am picking it up as I go along.
Please can someone explain to me how to store a dynamic number of variables so that they can recalled on future pages. i.e. I wish to mimic the functionality of a...
I am developing my first PHP application and would like some help writing a function to find the number of days between a date stored in a mySQL database and the current date.
If anyone could help me with this, I would appreciate it.
Thanks.
Hi,
I am having problems with session variables. Initially I set the variables using:
session_register('unittitle','unitcode','unitcodepk');
These variables can then be used in different pages by refering to them as $unittitle etc...
Once the user has entered all info, I save the values of...
Hi,
On my site a user has to enter data into a textarea. However, when the data is re-displayed on another form, if the user has entered characters such as \ or ' etc, they are always preceeded by a \.
How can I overcome this? I'm sure it's very simple, but this is my first php project and I...
By reversing the order of the insert values, it now works!
$sql = "INSERT INTO ModLoginTable (password,ModLogName)
VALUES (password('$randompassword'),'$modlogname')";
mysql_query($sql) or die ("Cannot create a new entry in the ModLoginTable Table" ...
The error message I get is:
Cannot create a new entry in the ModLoginTable Table You have an error in your SQL syntax near '' at line 2
Thanks for the help so far :)
Rob
I am attempting to save a password to a mySQL table using the following code:
$sql = "INSERT INTO ModLoginTable (ModLogName,password)
VALUES ('$modlogname',password('$randompassword')";
mysql_query($sql) or die ("Cannot create a new entry in the Table");
However...
Hi,
I am undertaking my first project using PHP and mySQL.
What I wish to do is:
After a user has completed a form, I wish to query a table to see if a record with the same name exists. If this exists, certain fields in that record should be updated.
If a record does not exist, a completely...
Hi,
This is my first PHP web app and I am I getting stuck with this:
I have a site where the user logs in under a session. Once logged in, there is a web form that has to be filled out. I have a script that validates the input, but I am having problems giving feeback to the user.
What I...
Hi,
I am quite new to PHP and wonder if someone could help me with the following problem.
I have a form which contains a drop down menu where the user can select two different values. What I would like to do is change the form action field depending upon which of these values is selected...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.