Jump to content

jcbones

Staff Alumni
  • Posts

    2,653
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by jcbones

  1. Also add: $searching = $_POST['searching'];
  2. Modify your code to reflect it. $msgColor1 = array(); foreach ($playerName1 as $value) { $msgColor1['name'] .= $value[$i]; //<- you are referencing value as an array, which would split the string by characters. remove the [$i], and you are good to go. $i = $i + 1; } So it should read. $msgColor1 = array(); foreach ($playerName1 as $value) { $msgColor1['name'] .= $value; $i = $i + 1; }
  3. $value is probably a string, and not an array.
  4. Try replacing the while statement with this one: while($row=mysql_fetch_assoc($result)){ $data[] = $row; //make sure $data is an array, so it captures all of the data, and not just the last row. }
  5. Yes.
  6. $some_array[] = array( 'member_name' => $row['pf_firstname'] . " " . $row['pf_lastname'], 'member_title' => $row['pf_title'], 'member_employer' => $row['pf_employer'] ) *clarification* To display this: foreach($some_array as $value) { echo $value['member_name']; //etc. }
  7. So you only want to fetch the array if the query doesn't return rows? At least, that is how the code is written.
  8. That is what extract() does.
  9. I have found that a lot of host will not send emails unless the From: header is a valid email address hosted on their server. So you would need to set their email address as the reply-to: header, so that a valid address could be placed in the From: header.
  10. This should help you. Pagination
  11. Wrap each <table></table> in a division element. Example echo '<div style="float:left"><table>'; //the while statement. echo '</table></div>';
  12. As btherl says. $date = new DateTime(null,new DateTimeZone("Europe/London")); $date->setTimezone($timezone); $dateTime = $date->format('H:i:s d/m/Y'); $sqlDateTime = $date->format('Y-m-d H:i:s');
  13. Thorpe's will work, but if you need the w's turned to s's also, then you may think of something like this. $link = $_GET['album']; $link = (substr($link,-1) == 's') ? substr($link,0,-1) . 'w' : substr($link,0,-1) . 's'; //if last letter is 's', then change it to 'w' else change it to 's'. echo '<a href="' . $link . '">New Album</a>';
  14. You may have to specify the host.
  15. Try: <?php $file = file_get_contents('contents.txt', 'r'); if(session_is_registered(myusername)){ ?><a href="javascript:open4()"><?php echo $file ?></a><?php } else { echo $file; }?>
  16. Yeah, you will have to read them with a foreach. It is not advisable to save them as a comma separated list in mysql. I didn't go into all of that, but just answered your question. I have no idea what 'igraci' means, but would think that you should use a separate table to hold those values. Using a primary key linking back to the 'klanovi' table's row that those values are tied to. This lets you pull a table join to group all of those values. This would. A. Make it easier to manipulate the data. B. Make it easier to delete only one of said values. C. Further your database design in the the Normal Form.
  17. $igraci = implode(',',$_POST['igraci']); //from array to comma separated list. $query = "INSERT INTO klanovi (naziv, website, email, igraci) VALUES ('{$naziv}', '{$website}', '{$email}', '{$igraci}')"; $result = mysql_query($query, $connection);
  18. You will have to code the function call on the page reset, as the form cannot call a php function. At the top of your page test.php if(isset($_GET['addlunch'])) { addlunch(); } of course you will have to change the form action so that the addlunch parameter is set> <form action="test.php?addlunch=1" method="post" name="lunch"> After this, you will note that it still doesn't work, because your query doesn't have a table name. Because, $tbl_name is out of scope. Hard code it. Once you fix this, you will find that because you have failed to use any database sanitation, and are also setting your caller in the URL that this script has great potential to be raped by script kiddies. To fix, you need to at least run your form through mysql_real_escape_string(), and put you a hidden input into the form to trigger your database function.
  19. So give us the correct script, as guessing will get us no where. Therefore, we will continue to get feedback of "its still not working".
  20. What is your query. You should be able to use group by, or maybe distinct.
  21. You are missing the closing bracket on one of your if statements. I think it is if($ufile !=none) { But am not 100% sure.
  22. You are correct David, it should be in parenthesis. Quotes on INT column is moot, you can use them or not. It may be a little safer using them, if you security isn't top notch. Who can really say.
  23. You will have to add the table name to any column when using a join query. SELECT y.*, COUNT(ads.UID) AS posts FROM YBK_Login AS y LEFT JOIN YBK_Ads AS ads ON ads.UID=y.ID WHERE ads.`delete` = '0' GROUP BY y.ID
  24. $result4 = mysql_query("SELECT * FROM schedule WHERE eid = '$posteid' AND status = 1 OR status = 2");
×
×
  • 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.