![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
only one
-
Posts
437 -
Joined
-
Last visited
Never
Posts posted by only one
-
-
-
yea i think it should work the only thing is when you are checkning if it already exists when you are creating a new one
you might want to use the mysql_num_rows(); function to count how many of thing exists, then if($get_title > 0){ echo "already exists"; } else insert it...
-
make sure you are connecting to the mysql server
mysql_connect("world-casino-guide.com","username","password");
world-casino-guide.com is the web adress but not the place where the databases are stored
-
i cobe my webasite with includes, like,
include("$page.php");
the only problem is when a page doesnt exist i get an error like
Warning: main(the page.php): failed to open stream: No such file or directory in the place.php on line 1...
is there any way of stoping this from happening without haveing to do a big long list of if's or make up every page possible
-
yea, but he wants it to put a country in or not?
-
[b]ill get you started
what you want is something that stores the time someone sterted downloading something in a database,
let them fill in a form that lets them select their connection speed, then find out a sort of avarage download time
now you want something like[/b]
[code]
<?
//current time
$currenttime = date(YmdHis); // visit 'http://nl2.php.net/date'
//their ip
$ip=$_SERVER['REMOTE_ADDR'];
//calculations
$downloadtime = $currentime + their avarge download time;
//insert it into your database
mysql_query(INSERT INTO downloaders `downloadtime`, `ip` VALUES '$downloadtime', '$ip');
?>[/code]
[b]then i dont know how your site works but heres the code for retrieving it[/b]
[code]<?
//retreive stuff from databse
$time = date(YmdHis) + 50; //gives them 50 minutes from the hour to download it, if its any greater than 10 past the hour this doesnt always work very well, but this is only very basic....
$query = mysql_query("SELECT downloadtime FROM dowloaders WHERE downloadtime > $time") or die(mysql_error());
$row = mysql_fetch_array($query);
//allows no more than 10 peaople at once to download it
$num_rows = mysql_num_rows($query);
if($num_rows>10){ echo "currently unavailable"; }
else { echo "<a href=download url>Click here to download</a>"; }
?>[/code]
[b][color=red]this wont work![/color][/b] -
everyone starts from somewhere....
first you want to make a field
just call you first field "field" or something
type a number into the Length/Values* textfield id recommend 255 for now, this lets you only use up to 255 characters or numbers in your field wen you put something inside it "dont touch anything else yet", you can now create you table.
now that you have created a table with a field in it look along the top for a tab saying "insert"
type something into the textbox and click "go", this will insert a row into your table inside the database
there are alot of things fields can do, first of all the different types,
"varchar" lets any characters and numbers including <>!"£$%^&*(){}[]#/\| can be inserted into the field
"tinyint" just means, a few numbers
"text" lets you use as much of anything that you want, if you use text you dont need any lengths or values
youll get to know the rest as you use them
dont ask me what attributes are for because i never use them myself
NULL just means weather the feild is left blank or if it has a deafault (put it on "NOT NULL" it doesnt really make a difference)
the "Default**" just means that everytime theres a new row made that feild automatically gets the thing you want put into it automatically
the Extra usually uses an auto_increasement function, this can only be enabled if that feild is the primary key (note: there can only be one primary key) if you put it one auto_increasement id advise you to put the feild type on int, this only allows numbers to be used in the feild, the auto increasement function lets makes the every new row automatically get +1, eg: if you use an id for something like a user id, everyone that registers will automatically get a new id,
thats most of the basics
hope you understand, if you dont mail me
-
usually php comes with a hidden session id, as far as i know it the variable is $PHPSESSID
comes up one my site somethimes
http://mysticbattles.freehostia.com/index.php?PHPSESSID=936beaf3f53a8856b6c8aeb80876490c -
are you sure you are randomising where they are wen they are registering
try this
$rand=rand(1,9);
if($rand==1){ $country=England; }
else
if($rand==2){ $country=France; .....
-
could anyone help me make a hovering inbox sort of like the 'my assistant' featured in invision boards
non exisiting page
in PHP Coding Help
Posted
see wen i put the @ infrnt of my include, does that stop any other errors from showing up on the included file?