-
Posts
1,008 -
Joined
-
Last visited
Posts posted by spiderwell
-
-
theres no while statement, so it isnt looping
-
can you post the code you have?
-
And I've been told I can set up a cron job to run the randomization script once a week to changg the order again. (not sure if this is sort of what you meant spiderwell)
Once again, Cheers for the help
maybe, I not sure i know what a cron job is, but event is created on the mysql database and is a bit of SQL that is trigger at times you specify it for example:
CREATE EVENT `myevent` ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY ON COMPLETION PRESERVE DO UPDATE `mytable` SET `myfield` = NULL;
this sets a column to null once a day.
events usually drop after execution the on preserve bit means it doesnt drop the event once executed, so will run daily
find out more here http://dev.mysql.com/doc/refman/5.1/en/create-event.html
-
i thought that was only necessary with file uploads in a form
-
customers is typoed?
-
whats the full code of the page you post to at action="access/"
-
yeah its like 10% building and 90% making it unbreakable.
I am sure it will come back to you quickly!
-
Hi spiderwell,
I tried your way and it works but it adds the selected class on all the links how does it work where it only shows on the current page.
yeah i didnt look closely enough and if the script isnt changing the category is which is why my code didnt work
-
yes you would want 2 tables
say, one with artists, the other with songs, and use the primary key of artists to link to songs to identify all songs by that artist
-
php self would work, but that wil stop working at some point if the querystring changes, why not do a substring check for the filename , thus avoiding the querystring.
<li><a href="gallery.php?category=Wedding" id="wedding" <?php if (substr($currentPage ,'gallery.php')) {echo 'class="selected"';} ?>>Wedding Hair</a></li>
-
perhaps if you used activeX? im not sure really, but maybe also a link to where you expect windows explorere to be:
<a href="c:/windows/explorer.exe">clicky</a>
if it works in browser why not use that
-
the variable is only defined if this statement is true, i think
if($results = mysql_num_rows($sql_query) != 0)
and im a bit confused by that statement in itself anyways, what are you trying to do here exactly?
-
wow 4 year old thread bump! i just learnt how to do this last week by reading the sticky located here, its about halfway down the first post:
-
everytime you use the header file you are implicitly setting the Session userid to 0, i wouldnt bother to do this, its either going to be filled with the users ID or not exist (ie login has failed)
in effect you are logging them out on every call of a page with the htmlheader.php included in it
just do:
<?php if(!isset($_SESSION)){ session_start(); }
then put the whole login script into an if statement that only triggers if form is posted.
-
im pretty sure you can do it as simply as this
<a href="ftp://mydomain.com">click here</a>
if your domain name is set up correctly.
-
mmmmm
ok blobs are binary large object, essentially what an image is if its stored into a db, alternatively images can be just saved on the server in a folder.
first off you should build a search form, that posts to a results page (or itself)
then pull the information from the form, and take that to put into your mySQL search statement.
then parse the results accordingly
roughly something like this:
$search = $_POST['searchinput']
$sql = "SELECT * FROM Tbl_BLah WHERE `Something` LIKE '%$search';"
//i skip now to results loop, assume $row is my dataset aray
echo "<img src='" . $row['image'] . "'>";
echo "<a href='details.php?id=" . $row['id'] . "'>Click for more info</a>";
echo "<br>" . $row['smalldescription'] ;
-
what is the code on the index page look like,I assume you are starting the session on that page too ?
-
create an event on mysql directly to trigger once a week?
-
I not sure I folow what you are after, do you want a link that links via FTP instead of http?
Not sure where a form would come into that.
Do you want a link that goes to a website and then that website requires you to login to it?
-
don't listen to your friend or anyone when it comes to how hard coding is, I find its different for everyone learning, and for me, PHP was VERY easy to learn, picked it up in about a week, but thats with a background of scripting in ASP for many years. For me, its all down to logic, and if you remember that its pretty easy really.
THe problem I have I dont know half the commands available in PHP, and am probably missing some great little features.
Also when i have 2 tables that share a unique ID, i tend to make the second table with an ordinary incrementing ID as the primary key and another column with the foreign key (although I am very bad at actually making it a foreign key, i just name it user_ID or something that indicates its an ID from another table)
oh and everytihng I have ever learnt in code has pretty much come via google!! I bought the odd book years ago when I first started out, but the rest is just out there waiting to be discovered
-
personally i wouldnt bother (I'm lazy), but i would say it better practice to declare, as it eliminates the possibility of what you see happening locally happening on the live site.
-
$_SESSION['user'] is holding an email address, and therefore cannot be inserted into an integer field in a database, whereas the ID can
-
if the relationship between tables is 1 to 1, is there really any need to have a second table? thats what i am thinking now, that said maybe its more efficient to have a small table for logging in.......
-
yeah what confused me most was that I thought a count was necessary, when really its a sort of boolean search, there either is or isnt a curse word, one instance will make it true.
thats why my final snippet was much shorter, as no counting was involved
SELECT - data from two tables
in PHP Coding Help
Posted
you could use a JOIN query in SQL but that would give you multiple entries for profile id,
personally i would do it it with 2 loops
so loop through all profiles, and inside that loop, loop through all interests against the profile id
*DISCLAIMER* i havent checked this code but its just to show you what I meant![:)](https://forums.phpfreaks.com/uploads/emoticons/default_happy-01.gif)