Jump to content

Chris.P

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by Chris.P

  1. Not entirely sure what you mean but the the casting of the variable and the url the variable is being used in are all within the same block of php code if that answers your question.
  2. I'm trying to get a variable from one page to another using variables in the URL. I have this working fine from some pages but not others. So starting on one page I have this section of code. else { header ("Location: user.php?band=$bandid"); } The variables work fine and it takes me to the user.php page. On user.php I am using the following to get the variable in the URL to a variable in the page which also works fine because I can echo the values out just fine. $bandid = $_GET['band']; echo $bandid; My problem comes when I try use the variable on user.php in a link on that page like this. <a href="image_upload.php?band=$bandid">Upload Image</a><br /> Instead of the link showing the contents of the variable it shows me the variable name. Any help I'm baffled. ???
  3. Right, I'm confused now. I can see how to set an index on a field although I can't see how this helps me to link the tables through a reference id. Like I said in my first post I have two tables like this: User Table ImageTable ID ID Name Location DOB Size User table is populated every time somebody signs up through the sign up form, Image table is not. So obviously I want the ID's of both tables to stay the same so I can reference them when the Image table is updated. ImageTable needs to reference the User table so which ID field do I index? And how does Imagetable know to look in UserTable for its ID? I know how I would do this in Oracle with primary and foreign keys although I see MySQL is slightly different and I don't understand this indexing business to well. ??? ???
  4. Yeah I'm using phpmyadmin, its easy to use the basics although useless if you don't know what everything does, which seems to be my problem.
  5. Ok cheers I have added an index to one of the tables, should I have added it to any particular one? And also if I set an index on the id field of one table how does it know its indexing the index of the other table? A little confused I think. ???
  6. Ok, how do I go about doing that? ???
  7. I can't for the life of me figure out how to edit my post on this forum so heres a reply of a little more info on what I'm trying to do. I have two tables one with user info inside it and one with details about images uploaded, obviously when I user logs in I want to call the user data from the user table and the related user picture from the picture table. Best way I presumed to do this would be to use a foreign key like so. User Table ImageTable ID ID Name Location DOB Size etc... Obviously ID primary in User table and foreign in Image Table. :-\ EDIT: Now I see how to edit although the edit button was covered up by that google ad in my first post, how annoying! :-\
  8. mysql version: 4.1.21 I am creating a database using MySQL and need to create a foreign key. From what I have read this is not possible in MySQL? I have browsed through phpMyAdmin and cannot see the option so far. I have not tried doing it through basic MySQL commands as of yet as I don't know how to do it without rebuilding my tables. If it is not possible I presume the only way will be to throw all the fields into one table? Any help much appreciated.
  9. I have created a little website with login and admin area that updates the sites content. I need to figur eout what the best way is to stop people who are not logged in going direct to my admin pages for example just typing in /admin.php when nobody is logged in. I read this can be done using cookie although I am not sure how and I have created a session so was wondering if it could be done via that? A little unsure here! :-\
×
×
  • 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.