
markbett
Members-
Posts
133 -
Joined
-
Last visited
Never
Everything posted by markbett
-
I want to select the highest scores from a database
markbett replied to Rosst's topic in PHP Coding Help
lol the irony that you have PHP tutorials on your site... well that and your flash logo is illegable... just so you know descending means it starts big and gets small at this very moment the list isnt in desc order.... furthermore you will need to explain WHAT is not working... saying ITS NOT WORKING will do no good and is the reason why "none of (us) are helping you" -
I want to select the highest scores from a database
markbett replied to Rosst's topic in PHP Coding Help
you are using ASC dont you want DESC -
my index page has [code] session_start(); session_name('SBQA'); header("Cache-control: private"); // Fix for IE [/code] before i put anyhting out to the browser...
-
and you select the CLICK HERE link so you could see the events details and the whole event description etc etc then you clicked on the name of the EVENT HOST and were brought to the messenger page??
-
on my site when a user logs in a number of session variables are set for them [code] if(mysql_num_rows($validate) == 1){ while($row = mysql_fetch_assoc($validate)){ $_SESSION['login'] = true; $_SESSION['userid'] = $row['id']; $_SESSION['first_name'] = $row['first_name']; $_SESSION['last_name'] = $row['last_name']; $_SESSION['email_address'] = $row['email_address']; $_SESSION['username'] = $row['username']; $_SESSION['cid'] = $row['cart_id']; setcookie('cid', $unique_cid, time()+24*3600*60); //security for sess hijack// $_SESSION['user']->fingerprint = md5($_SERVER['HTTP_USER_AGENT']);[/code] as you can see in the code additionally in my code i set [code]session_start(); session_name('SBQA'); header("Cache-control: private"); // Fix for IE [/code] before i spit anything out the problem i am having is when you are logged in ( http://www.mygaysf.com/sbqa you can log in using phpfreaks / password ) you will see that it correctly knows that you first name is "PHP Freaks" now if you click on lets say the 15th in the calendar then VIEW EVENT if you select the EVENT HOSTS name (a link so you will be able to send them a message) you will see that it has now changed your name in the welcome box. There is NOTHING that should be resetting this session variable.... that code is simply: [code]<?php if($_SESSION['login'] == true){ // show logout hyperlinks echo 'Welcome</td></tr><tr><td>- Welcome '.$_SESSION[first_name].' to the SBQA website. Click '.$nav_class.'../sbqa/logout.php">HERE</a> to end your session and log out.<br />'; if($_SESSION['useradmin'] != TRUE){ echo '</td></tr></table>';[/code] also on the next page is has changed who you are (the FROM box) i only set the session variable FIRST NAME one time when you log in... the only change i do make is on the event view page i do add a session variable so that I can determine who the evnet host is for the last event they viewed but that should not have any effect on this at all as that code is simply: [code] //we set variables here for the contacts $_SESSION['host_name']= $event_host; $_SESSION['host_email']= $host_email; $_SESSION['subject']= "Re: SBQA Event ".$title;[/code] so WHY oh why is this happening to me??
-
yeah he is... i dont kn wo why but ii swear ive used the same code previously wihtout any issue grrr thank you so much it was annoying me i couldnt get it....
-
it only runs one topic and fills in all the subcategories of that topic but never moves back into the first while loop to finish it out
-
Need help with a search script. *SOLVED*
markbett replied to pocobueno1388's topic in PHP Coding Help
well you can look to see which fields are set and if the user hasnt input any data into a specific textbox/field then you ignore it in your query.... -
I think perhaps what you are asking now is if you can sort the array you are keeping the data in and the answer to that is yes: http://www.developertutorials.com/tutorials/php/sorting-array-php-051114/page1.html
-
check your hosts FAQ's normally they will give you proper settings when creating this file
-
my code (see below) should work as follows 1) run a sql query and get get all the topics and their ID# (this returns 4 topics right now) 2) while the topics are being returned 1 row at a time I take the topic ID and run a second SQL query using it to find all the links in the link table and echo them out 3) once all the links are done, we should move on to the next topic and then so on doing the same thing for each of the 4 topics the problem is that this code is only working for the very first topic.... WHY!?!?! [code]<?php include $_SERVER['DOCUMENT_ROOT'].'/sbqa/layout2.php'; $row=''; $sql = mysql_query("SELECT * FROM link_types"); while($row = mysql_fetch_array($sql)){ stripslashes(extract($row)); echo '<table border="0" align="center"> <tr> <td colspan="2" class="box_title">'.$type.'</td> </tr>'; $sql = mysql_query("SELECT * FROM links WHERE (type_1='$type_id' OR type_2='$type_id' OR type_3='$type_id') ORDER BY title"); while($row = mysql_fetch_array($sql)){ stripslashes(extract($row)); echo'<tr><td><a href="'.$url.'">'.$title.'</a></td><td>'.$description.'</td> </tr>'; $url=''; $title=''; $description=''; } echo '</table> <br /> <br />'; } ?>[/code]
-
[code]thats no different the the first query i tried {code]SELECT anti_spam.as_email FROM anti_spam LEFT JOIN users ON anti_spam.as_email = users.email_address WHERE newsletter = 0 OR users.email_address IS NULL[/code] all i need to do is pull all the email addresses where the anti_spam table doesnt have a 1 for the column
-
example data? well there isnt any... when i run that query i come back with NO results... there are users in the USERS table and nothing is stored inthe anti_spam table so i want all the users to be returned...
-
ssl isnt a feature of php its something that runs on the webserver
-
i've tried a bunch of queries and im still not getting what i need... [code]SELECT anti_spam.as_email FROM anti_spam LEFT JOIN users ON anti_spam.as_email = users.email_address WHERE newsletter =0 OR newsletter IS NULL [/code]
-
you could...
-
thank you for your help but this isn't quiet right running the query comes back with no results [code]SELECT anti_spam.as_email FROM anti_spam LEFT JOIN users ON anti_spam.as_email = users.email_address WHERE newsletter = 0 OR users.email_address IS NULL[/code] this query also doesnt seem correct because i dont need where the users.email doesnt exist.... the problem is that users can exist in the anti spam DB and not exist in the users.... this is so you can say i am not a member and i never want to see anything ever from you... additionally if you are a member you may not want to be in the anti_spam db so you wont eer have an entry in there
-
I am strugling with how to properly write this sql query. I have 2 tables users and anti_spam I need to select the email address of all users who have not unsubscribed... antispam has columns id email_address, events, newsletter, invitations, news.... so if a column is marked then the email address in question has unsubscribed so basically its is a query where i say join on email addresses where newsletter = '0' is that right? Im not too good with complex sql queries... oh and for clarification there are email addresses that will appear in the anti_spam database table that will not be in the users table..... so essentially i need to get all the email addresses and drop ones where a column has a value of 1 but if there is not match for that column then we assume its 0 wow my explination suxs but i dont know how to explain it
-
[quote author=thorpe link=topic=108587.msg437613#msg437613 date=1158714131] php runs on the server while javascript runs on the client. You are mistaken in your belief of how your code works. Maybe you are using some ajax type trickery or are reloading the page, but you sure ARE NOT executing php from within an onmouseover. Good luck getting a patent. [/quote] probably they are calling na actual page so the on mouseover is actually opening a new page cause the server to parse that new info....
-
you cant patent code...
-
are you really setting your year to 200?? maybe that is your issue
-
oh and for clarification there are email addresses that will appear in the anti_spam database table that will not be in the users table.....
-
I am strugling with how to properly write this sql query. I have 2 tables users and anti_spam I need to select the email address of all users who have not unsubscribed... antispam has columns id email_address, events, newsletter, invitations, news.... so if a column is marked then the email address in question has unsubscribed so basically its is a query where i say join on email addresses where newsletter = '0' is that right? Im not too good with complex sql queries...
-
Auto increment a number for every 10 seconds
markbett replied to lilywong's topic in PHP Coding Help
why not calculate it based on the actual times so $start=time() $end=time() $start-$end give you millaseconds (i think its millaseconds) diference so then do your math from there -
umm try setting your php.ini file