182x
-
Posts
179 -
Joined
-
Last visited
Never
Posts posted by 182x
-
-
Hey guys, I am new to PHP and I was just wondering should I setup PHP 5 or PHP 4? I was also wondering if anyone has a guide about how to get PHP to work with apache?
Thanks for any advice.
-
Hey guys, I have managed to get the file uploading working on my site using php so that users can upload documents. However I have run into the problem that I am not sure how to allow users to download these documents I have tried: <a href="uploadedWork/test.txt">test</a>
but rather than giving the user the option to save or open the file it just opens it, any suggestions?
Thanks. -
Thanks for that :)
-
Hey guys,
I have a table which simply outputs memberId numbers but i would also like another two columns on the table which contain hyperlinks so the user can click them to see various results and stats.
I am a bit confused by this and was just wondering how can I add hyperlinks in this way to each of the dynamic memberIds that are being produced in the table?
Thanks. -
Hey guys, I have done a basic query:
[code]
select d, f from acc where cId= $_session cd;
[/code]
So far when using this query with php it displays the data in the order it was entered which is what I want but I was wondering will it always do this or will i need some form of order by? Thanks.
-
Thanks, its just I have to get this to run on a version of PHP that still uses $HTTP_SESSION_VARS rather than $_SESSION. Is that version 4.x or would that be a lower version?
-
Thats awesome thanks sooo much :)
Will this technique work will older versions of PHP such as 3 and 4? Also can you guys recommend any good PHP books? -
Sorry for the newbie questions but does that work with a regular HTML table so it will resize when data is inderted and deleted?
-
That woks now thanks so much for your help :)
I have one more question for formatting purposes if I were to put data like that into a table then records get inserted or removed from the database how would the table know ot resize?
and thanks again!!! -
I would like to display all 3 of the rows. Does that cause problems?
-
Here is the sql: (the table currently has over 30 records in it)
[code]
DROP TABLE IF EXISTS acc;
CREATE TABLE acc (
traId int(19) NOT NULL auto_increment,
tri varchar(29) NOT NULL default '',
trao float(19) NOT NULL default '0',
rId int(10) NOT NULL default '0',
PRIMARY KEY (traId)
);
[/code] -
Hi sorry i have only been using PHP for 3 days. The table name is acc however im not sure what you mean by your second question.
-
Thanks again for tour reply, I am still having the problem that the data isn't actually being displayed although there is space being left for it. I have checked the database and there should be 34 records being displayed.
Any more ideas? and thanks again. -
When I use the above code I recieve the following error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING -
Thanks for the replay, using your code above doesn't display any error messages and on screen it leaves the space where the data should be displayed but no data is actually displayed on the screen.
Any suggestions? Thanks. -
Hey guys, the following code is to help me display a list of data from a database but for some reason the data is not being displayed. Any suggestions? Thanks
[code]
$sql = "SELECT * FROM acc";
$query = mysql_query($sql);
while ( $row = mysql_fetch_array($query))
{
$data = "".$row["data"]."";
echo "$data <br><br>";
}
[/code] -
Hey thanks for your reply.
I have tried the method you have suggested but it turns up the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in Ne\tr.php on line 11 -
Hey guys, sorry for all the n00bie questions however this time I am wondering how to display a set of data from a database. For example if the database has 4 columns cId, ty, dId, am and I would like to display all the information in a table where session id = dId. I can create the query but how do you actually display this information?
Thanks. -
Nice one thanks guys for the syntax of number_format() when dealing with session variables I have to leave off the quotes is the following correct:
[code]
echo number_format($HTTP_SESSION_VARS['curr'],2)
[/code]
or should it be:
[code]
echo number_format("$HTTP_SESSION_VARS['curr']",2)
[/code]
-
Hey guys,
In my datbase I have a field called amount which is a float so if I enter 12.24 thats fine but if I add .06 ot that it will be entered in the database and displayed as 12.3 rather than 12.30 is there a way to change this?
Thanks for any help. -
hey guys, I am deadling witha very old version of PHP and I have to use $HTTP_SESSION_VARS for my session variables and I have created a simple logout script which can be seen below however I am getting the error message: "Warning: Trying to destroy uninitialized session in /test/cgi-bin/file/logout.php on line 2"
Any ideas where I have went wrong? Thanks.
[code]
<?php
session_destroy();
header("location:back.php")
?>
[/code] -
Hi thanks for your reply, I have tried this but the query still won't insert the records, any ideas?
-
Hey guys
I have created the following two queries the first one works fine however the second (insert query) )doesn't. No error message is supplied the data just doesn't enter the table. Any advice would be great thanks.
[code]
$query="UPDATE cu SET curr ='".$HTTP_SESSION_VARS['curr]."' WHERE Id = '".$HTTP_SESSION_VARS['Id']."'";
mysql_query($query, $link_id);
$query2="INSERT INTO acc VALUES('','$tha', '$dep', '$HTTP_SESSION_VARS[Id]')";
mysql_query($query2, $link_id);
[/code] -
Hey guys, I am using the following code to try to insert a record into a table but its not working and I was just wondering why and also it has to work with an older version of PHP 4.x so i was just wondering is this possible?
Thanks for any help.
[code]
<?php
session_start();
include('db.php');
$link_id = db_connect('');
$query="INSERT INTO c (cur) VALUES('$HTTP_SESSION_VARS['curr']')";
mysql_query($query, $link_id);
header("location:de.php");
?>
[/code]
PHP 5 or PHP 4
in PHP Coding Help
Posted
Thanks would you also recommend the WAMP package or downloading php, mysql, apache etc on their own?