Jump to content

dogbiter

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dogbiter's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks i looked at the first one it's very informative but not quite what i was looking for i'll check out the phpfreaks one now
  2. so i'm just curious how the while(), do..while, for(), and foreach() loops work differently because when i do a normal mysql query in php the foreach() will return the array but if i do a join or a query involving more then one table then the foreach() loop doesn't work and i have to user a while() loop just curious how they work differently if someone wants to explain it or point me to a book or web site that explains it i will be very appreciative.
  3. nvm i relized that i had set the column to varchar(30) and the hashes are longer then that that's why it wasn't working.
  4. i'm trying to get a password script to work with a basic user name and pass table i can get the info into the table and the password hashed as PASSWORD() or sha1() but if i try to check a password against it the lines come up empty just wondering what is the syntax to checking a password against a password stored in the database...i've poked around and couldn't find any help.
  5. thank you very much though it will bug the crap outta me untill i figure out how i had that other way working i like using implode works great. i had never seen it is that new??? or have i just never seen it???
  6. thank you for the help I'll try that(i connot right now as i'm on windows *need to restart to linux) and "implode()" is new to me and i know that the "fetch_array" got rows but the reiteration was supposed to display each row. I've gotten it to work by starting the starting at $i=1 instead of 0 and using the ID column in a "where" section of the query but that only works if the table has an ID column and it's sequential.
  7. oh here we go function DB($db){ $query = "select * from $db"; $result1 = mysql_query($query) or die(mysql_error()); $result2 = mysql_fetch_array($result1) or die(mysql_error()); echo "<table border=3>"; for ($i=0;$i<=mysql_num_rows($resutl1);$i++){ $id = $i; echo "<tr>"; for ($d=0;$d<mysql_num_fields($result2);$d++){ echo "<td>".$result2[$d]."</td>"; } echo "</tr>"; } echo "</table>"; } ok that's simplified to what it was when i first started working on it
  8. yes there are a few that are identical and i noticed that when i set variables in different places they did different things. and i'm sorry about "between" it's 5 am and no sleep but have they changed the way you have do loops??? or is what i have supposed to work??? like i said i've gotten it to work in the past but i cannot figure it out and most of that is off of memory.
  9. have they broken loops between php and mysql in recent versions??? i have PHP Version 5.2.4 and mysql 5.0.51a and i'm trying to get a simple patch of code to display everything in any given table. i've gotten it to work befor but it was over a year ago and almost forgot everything about php and mysql LOL. so i'm trying to keep it simple. basically here is the code ..... function DB($db){ $query = "select * from $db"; $query1 = mysql_query($query) or die(mysql_error()); $query2 = mysql_fetch_array($query1) or die(mysql_error()); echo "<table border=3>"; for ($i=0;$i<=mysql_num_rows($query1);$i++){ $id = $i; echo "<tr>"; $query7 = mysql_query("select * from $db"); $query6 = mysql_fetch_array($query7); for ($d=0;$d<mysql_num_fields($query7);$d++){ $query3 = mysql_fetch_array($query7); echo "<td>".$query2[$d]."</td>"; } echo "</tr>"; } echo "</table>"; } i've gotten the loop to work but it just fills it with the same lines over and over again. sorry it a little jumbled but i've been poking at it for a couple hours now or more. i had it working but i added a where statement to make the numbers the same as an ID column in the table BUT then it only works with tables with ID columns in sequential order.
  10. thanks i'll see if i can get that to work LOL just getting back into php for like the 100th time so i'll pull it apart and try to understand it. thanks
  11. ok i'm useing the new 5.0.12 mysql version. and PHP Version 5.2.4-2ubuntu5.1 so my question is i know how to dynamically create table rows and fill them with what's in the table selected but i don't know how to get the titles of the columns that i'm looking at. this is how i'm getting the info posted on the site, very basic. <? for ($i=0; $i<$query3; $i++){ echo "<tr>"; for ($d=0; $d<$query4; $d++){ echo "<td>".$query2[$d]."</td>"; } echo "</tr>"; } ?> </table> if you can help me get the titles above the columns i would be grateful.
×
×
  • 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.