Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. That happens if you don't close a code tag (or, i believe, if you close one without opening it)
  2. I always read it as 'goes to', but then that's probably just me! So yes, it's just used to give a key a particular name, rather than just having numerical keys. You use it when creating an array: $array = array('mykey'=>'myvalue'); Therefore, to access myvalue, you would need to use $array['mykey']. And you also use it if you wish to access the key as well as the value in a foreach loop. foreach($array as $k=>$v){ echo 'The key is: '.$k.' and the value is: '.$v; } If you just want the value, you can do this: foreach($array as $v){ echo 'The value is: '.$v; } Sometimes people confuse the operator with this: -> which is completely different. -> This is used to reference properties or methods of classes (see here).
  3. Try: $$name = $_GET[$name]; Variables inside single quotes are not parsed. Therefore, your previous line tried to access the element of the $_GET array that had the key $name, rather than that which had a key which was the value of $name.
  4. You still didn't answer my first question im afraid.
  5. That would be because there isn't a row in your result set called Count. You're using an alias on the table name rather than the selected row. $sqlhits = "select count(EventID) as Count FROM EventLog WHERE Hit = 'Y'";
  6. Something like this? $array = array(); while ($row = mssql_fetch_array($sr)) { $array[$row['UserNum']] = array('First Name'=>$row['FirstName'],'Last Name'=>$row['LastName']); } echo '<pre>'.print_r($array,1).'</pre>'; Of course, if you just have two things to store in your array, it would be easier to store it as First name => Last name.
  7. Right. And what does 'doesn't work' actually mean? What happens? What doesn't happen? What's supposed to happen? Do you get error messages?
  8. Checked your error log? Do you have the rewrite_module loaded?
  9. You need use apache's mod rewrite setting. This subforum should get you started.
  10. Why on earth should someone help? People aren't paid to help you know. No doubt you've extensively googled the subject and couldn't find anything.
  11. Well, as far as I can see $line is undefined and you're not actually reading anything from the file. feof() does not read anything. What are you actually trying to achieve? Chances are, you're making this more complicated than it needs to be.
  12. And you needed to create a new topic rather than adding this to your old one because?
  13. delete is a reserved word in mysql. Either place backticks(`) around the fieldname or (better) rename your field.
  14. No idea. What happens? Add an or die statement: $result = mysql_query("SELECT * FROM requests WHERE MONTH(acctime) = '06' ORDER BY id ASC") or die(mysql_error()); What's the formate of acctime?
  15. That would meant that your query is failing. Try this: $result = mysql_query('SELECT Sum(fines.fine_amount) AS SumOffine_amount, profiles.name FROM fines INNER JOIN profiles ON fines.profile_id = profiles.profile_id GROUP BY profiles.name ORDER BY Sum(fines.fine_amount); LIMIT 0, 30 ', $con) or die(mysql_error()); Also, next time please put tags around your code. P.S. Welcome to the forum
  16. strototime() is your friend: <?php for($x=0;$x<6;$x++){ echo date('F',strtotime('-'.$x.' months')).'<br />'; } ?>
  17. Couple of different approaches: echo $foo.'|'.$bar; //or: echo "$foo|$bar"; Basically, variables inside single quotes are not parsed. That is, if you echo this: echo '$var'; Then all that will be displayed is $var. However, they are parsed (and therefore their value is displayed) if inside double quotes. So you either place them inside double quotes or use no quotes at all and concatenate.
  18. Yes, you can do it with flush(). If you read the notes on the manual page, you will see why it doesn't work with such short output.
  19. lol. To be honest, I didn't even really read the question. I gave up after the 4 billionth "quick question" (slight exagerration, but not much: http://www.phpfreaks.com/forums/index.php?action=profile;u=64096;sa=showTopics). Don't get me wrong, I don't care if someone asks lots of questions. But I would have thought they would at least bother to give their problem a proper title.
  20. Well, in your loops you just overwite the same variable -- it doesn't achieve anything. Try this: $emails = explode(',',$_POST['email_to']); $names = explode(',',$_POST['name_to']); if(count($emails) == count($names)){ $array = array_combine($emails,$names); foreach($array as $email=>$name){ echo 'Name:'.$name.' Email:'.$email.'<br />'; } }else{ echo 'Names and emails do not match!'; }
  21. Seriously, can you please bother to name your topics appropriately?
  22. lol -- it's not often you solve two people's problem with the same post If you're happy, can you mark the topic as solved please?
  23. Could be wrong, but i think they were referrering to preventing other people using an extension on his own site. In which case, no. Why would you want to?
  24. Nope, that's a perfectly fine thing to do too. Pretty sure you'll find tutorails for it as well. Though it of course a different thing to having a database, which would allow you more control and allow pictures to be linked to users (spose you could do that through file/folder naming, but it wouldn't be pretty) and allow people to browse pictures linked to a user etc.
  25. A random user? What are you doing to do, force them to upload a picture? If you google you will find TONS of examples for this kind of thing. You might have to view tutorials for different bits to get the gist of it though.
×
×
  • 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.