Jump to content

182x

Members
  • Posts

    179
  • Joined

  • Last visited

    Never

Posts posted by 182x

  1. 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.

  2. 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.
  3. 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.
  4. 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.

  5. 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!!!
  6. 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]
  7. 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.
  8. 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]
  9. 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
  10. 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.
  11. 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]
  12. 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.
  13. 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]
  14. 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]
  15. 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]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.