Jump to content

mjcoco

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mjcoco's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Another question. Say i am at http://www.example.com/view.php?id=1&dept=2&cat_id=5 And i wanted to make it to where i can co back from what has been selected and take out &dept=2 making it = http://www.example.com/view.php?id=1&cat_id=5 Is there a query that i can go about doing that or do i just have to rebuild the entire url?
  2. Exactly what i was looking for. THANKS!!! I guess i just wasnt thinking, i tried just adding &cat_id= $cid and it was messing up the url... but that works great.
  3. Maybe alittle more code? Make sure your table name is correct, as in case.
  4. I know this isnt the best question or anything but basically i need help with passing a second variable. As in www.example.com?id=32 and seperately have it to where it displays a new list of links and when they click on that it will add in &cat_id=14 etc Basically its like narrowing a search click the first link that narrows it down with the id's=32 then then on the next page it will have new links to narrow it down even further. I have it to where it does the first, but im not sure how to do the latter (&cat_id=14) Thanks
  5. Ok so i added SELECT DISTINCT h.File and it got rid of the odd error, sorry for all the reply's was too long before i could use the modify.
  6. Forgot to mention the output comes out odd also... out put example outone outone outtwo outtwo
  7. I never really learned how to properly join tables, i did find a way to hack together some sql for it to work together anyway. Here is what i have. $q = "SELECT * FROM Homework h, University s, department d, course c, professors p where h.Universe = s.id AND h.Depart = d.dept_id AND h.Cour = c.course_id AND h.Prof = p.prof_id"; Which will produce the correct information needed however when i run $result = mysql_query($q,$conn); while ($a = mysql_fetch_array($result)) It runs twice. My main question is the first code... I know i should use a join however im not sure exactly how it goes. Something like this? ??? SELECT * FROM Homework INNER JOIN University WHERE Univers=id INNER JOIN department WHERE Depart = depat_id Second could my while statement be running twice because i dont have properly joined tables? Or is there an error in the query itself? Thanks,
  8. Im alittle confused. In the form, does the user determine how many records will be formed. If so why not get the value they input from the textfield and create a loop? If the user chooses 6 entries, is it going to be the same data for all six data entries?
  9. try taking out the quotes from echo "$my_order_id", i think it should just be echo $my_order_id; also if your method is post use <?php $my_order_id= $_POST['order_id']; $my_note = $_POST['order_note']; echo $my_order_id; echo $my_note; ?>
  10. <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="login" type="text" id="login"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="password" type="text" id="password"></td> </tr> <tr> <td width="5%" > <input type="submit" name="login" value="login"></td> <td width="5%" > <input type="button" value="register" onclick="window.location.href='registrationbackup.php';"></td> </tr> first maybe change the login for each name, textfield and submit. Since you have login for the input for text and for the submit. second im not sure that onclick="window.location.href='registrationbackup.php';" is necessary, you can probably just use onclick="registrationbackup.php" Also try print 'alert($myusername);'; see what it gives you, if its giving you what you typed and whats in your database, its you query
  11. Ok, i figured it out. While i was calling the ajax function it was named wrong. Fixed it it worked perfect. Thought i checked it last night, oh well.
  12. Sorry this post might need to be in PHP rather than in mysql. :-\
  13. Im passing about 5 variables though post. Its sloppy, but im just trying to get it to work before i go back and make it run smooth. Anyway here is some code im having problems with.. Not sure if i need to post more of the code, but here is where, i believe the problem lies... <form id = "myform" enctype="multipart/form-data" action="upload_file.php" method="POST"> <table width="527" height="110" border="0" align="left" cellpadding="0" cellspacing="0"> <tr><td width="172" height="32">University:</td> <td width="262"><select name="Univers" onChange="getDepart(this.value)"> <?php displayUniversity();?> </select></td> </tr> <tr><td width="172" height="32">Department:</td> <td width="262"><div id="departdiv"><select name="Department" id="Department"> <option>Select University First</option> </select></div> </td> </tr> My sql statement $de = $_POST['Department']; $q = "select * from department WHERE dept_id = $de"; $result = mysql_query($q,$conn); $a = mysql_fetch_array($result); Getting the Warning Which of course means that it is not getting a result in the fetch. I understand that. Here is my problem. I am passing 3 other variables which all execute perfect. This one on the otherhand is not. I cant figure out what the problem is or where it is at. The Univers _POST works great. However when i try it with the Department it does not run. Its partial code. I have it running with ajax (along with the other 2 variables that work fine) which populates the Department dropdown box. Any insight would be helpful.
  14. while($row=mysql_fetch_array($result)) { $rand="{$row['random1']}"; } This is an example of a scope. if you put a variable inside a while loop for example it will only stay there.
  15. I was reciving this error before. It has to do with the way you are accessing your database from the site. Like Xurion said it deoends on the provider some you can just type in the table name some you have to do domain_table name etc.
×
×
  • 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.