Jump to content

neller

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

neller's Achievements

Member

Member (2/5)

0

Reputation

  1. I think you have just forgot to add the variable part by looks of it Your current code doesnt add to a variable to echo out as u can see below.. '<a><button id="addtoDL" class="positive" style="margin:0 5px;">DOWNLOAD</button></a>'; You either need to add it to the variable you are using $insertgallery .= '<a><button id="addtoDL" class="positive" style="margin:0 5px;">DOWNLOAD</button></a>'; or echo it out echo '<a><button id="addtoDL" class="positive" style="margin:0 5px;">DOWNLOAD</button></a>';
  2. $count = count($links); // how many items are in the array // echo $count; exit; //this echo's 16...so there's stuff in the array $i = 0; // total count $s = 0; // table cell count...should ever get above the value of 3 while ($i <= $count) { if ($s == 0) { echo "<tr>"; } // if at the start of a table row, start the row echo $links[$i]; $i++; $s++; // print out the table cell with the proper value if ($s < 3) { echo "<td> </td>"; $s++; } // if we're not at table column 3, add a new column...this also should close the row with "null" values to fill in the table if ($s == 3) { echo "</tr>"; $s = 0; } // are we at table column 3? If so, close the row. } try removing the ; from the end of your while statement, I have done so above, I think that will fix it
  3. Making the following 2 changes will fix it.. 1 - change the text on your submit button, currently you have spaces " Register " , but in your PHP you are not checking for spaces you just have if (isset($_POST['submit']) && $_POST['submit'] == 'Register') So change your submit button to... <input type="submit" value="Register" name="submit" id="submit"/> then I always find wrapping my if statements in brackets is far better as it none of it will get run unless it passes your checks u are doing, so for example use this.. if (isset($_POST['submit']) && $_POST['submit'] == 'Register') { $query = 'INSERT INTO nelyn_user (user_id, username, password, email) VALUES (NULL, "' . mysql_real_escape_string($email, $db) . '", ' . '"' . mysql_real_escape_string($username, $db) . '", ' . 'PASSWORD("' . mysql_real_escape_string($password, $db) . '"))'; $result = mysql_query($query, $db) or die(mysql_error()); $user_id = mysql_insert_id($db); $_SESSION['logged'] = 1; $_SESSION['email'] = $email; header('Refresh: 5; URL=login.php'); } Hope that helps and all make ssense
  4. have you added single quotes either side of the username? it looks like you are escaping the query using the double quotes to use the $session->username variable but you need single quotes if so either side of those ' ".$session->username " ' (without the spaces)
  5. thansk for the reply guys. The server doesn't get tied up just that user, the page istelf uses loads of various tables the page loads pretty well due to the amount of data it displays, BUT the user has to wait for that page to load before any of the others will bother loading. The second that page finishes loading then the other pages load instantly again. If the same user was on the website using 2 different browsers / database connections, then they can easily load that big page in 1 and move around the site in the other, but this is not ideal as I need them to be able to do it in the 1 session. I tried doing a new / seperate database connect for that page, but that didnt work either
  6. Hi guys, Wasnt 100% sure how to title it but this is what I'm trying to do... I have a site where 99% of the pages load pretty fast but there is 1 page which takes about 3 mins to load (very big database useage) When the user opens this page they can't load any of the other pages until this one has finished loading, is it possible to say open a second connection when using this page so they can carry on using the rest of the site while this is loading? Thanks
  7. I have read the stickies and searched other threads but can't seem to find an answer, have not seen these in any of my mysql books either. If you had this Query..... SELECT DISTINCT ehorsename FROM entries WHERE rraceid = '1' AND ehorsename <> 'Horse Name' AND eprognum <> '' AND eprognum <> '0' What are the <> doing? I'm used to using them for "less than" or "greater than" but they are clearly not being used for this here, when used together do they mean something else? thanks
  8. Think you need to add ; to the end of your SQL statements
  9. Ok lets say I have a stored procedure called proc_getData which has 5 select statements.... Select * From table1; Select * From table2; Select * From table3; Select * From table4; Select * From table5; then within my PHP script I called the procedure.. CALL proc_getData(); How would it be possible to set each select statement from the procedure into different results? so I could loop through each as and when needed on my page? (hope this make sense) Thanks
  10. nevermind fixed it.... I just put ` around all the table names and it seems to have fixed the problem, I do usually use these in my queries anyways but left them out the function for some reason.
  11. Ok I have a pretty basic stored function but it returns a different result to the query inside it? let me show you a quick example so it makes more sense, here is the query and the result it returns... SELECT username FROM users WHERE user_id = 1; (returns "Player 1") however, when I use that exact same query within a stored function it returns a totaly different result CREATE DEFINER=`root`@`localhost` FUNCTION `get_Username`() RETURNS varchar(128) CHARSET latin1 BEGIN RETURN (SELECT username FROM users WHERE user_id = 1); END (returns "Player 2"); The table itself is just a basic one containing usernames with user_id as a Primary key. any help will be much apprieated
  12. ahhh I just thought of how to do it after reading your last post, and can do so from the 1 database loop Sorry its now off topic, I posted it in the MySQL section hoping the thing I was asking could be done in mysql, I'm pretty good with mysql but not on the advance level with functions and procedures etc so wasn't sure if it could be done that way. thanks for your help
  13. as in just a better way than I did it in my second post?
  14. Yeah sorry I did not post my code I usually would and I know you recommend doing so in that "please read" thread (I have read it ) The only reason I never is because imo it makes this simple problem look more complex than it is, I just figured the problem I listed in my first post was something simple I was just missing, anyways here is my code... SELECT `w`.`venuecode`, `w`.`workoutdate`, `v`.`venuename` FROM `workouts` `w` INNER JOIN `venue` `v` ON `w`.`venuecode` = `v`.`venuecode` ORDER BY `v`.`venuename`, `w`.`workoutdate` DESC in the above code just think of the "workouts" table as my "friends" table and the "venue" as "users" from my first post, I will try to be more precise when posting in the future
  15. Yeah that was pretty much what I was asking for help with in my original post As I stated in my second reply its probably not a good way to solve my problem and I would not recommend using it, but for now until I learn how to solve it in MySQL I thought I might as well post "my fix" just in case anybody else was totaly stuck for the time being. I'm usually pretty good with both joins and mysql, not sure why im so stuck here, probably missing something quite stupid.
×
×
  • 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.