View Full Version : PHP
Mr Macro
20-04-2007, 08:07 PM
Would
if(mysql_query(); == TRUE)
{
Would that say if the query made the table or not ?
Recursion
20-04-2007, 08:13 PM
Im no MySQL or PHP Expert but i think it may do it... :S Ask other people too though.
Invent
20-04-2007, 08:15 PM
Dude thats a stupid way to do it and no it wouldn't work im 99.99% sure.
Just do:
$query = mysql_query() or die('Error: '. mysql_error());
echo("yayz it workd");
Recursion
20-04-2007, 08:18 PM
See, I told you im no Expert :D
Mr Macro
20-04-2007, 08:20 PM
So, this would work.
<?PHP
require('includes/config.php');
for($K = 0; $K<sizeof($query); $K++)
{
$query = mysql_query($query[$K];) or die('Error: '. mysql_error());
echo("Tables created.Now, delete this file.");
?>
(Variables being in the config page)
Recursion
20-04-2007, 08:23 PM
Your making some sort of script, with an installer, which means your releasing something ;) or selling it :(
Mr Macro
20-04-2007, 08:24 PM
Indeed, i'm making a forum.. which i'm releasing in a few months.
(for free) :P
Recursion
20-04-2007, 08:27 PM
Nice, Bgi Project to do! It'll be the first opensource forum to be released on this forum lol.
I'd be happy to be a mirror when you release it and would you let me be the first to congragulate you on completion :P xD
Invent
20-04-2007, 08:29 PM
<?PHP
require('includes/config.php');
for($K = 0; $K<sizeof($query); $K++)
{
$query = mysql_query($query[$K]) or die('Error: '. mysql_error());
chmod("install.php", 0777);
unlink("install.php");
if(file_exists("install.php")) {
echo("Tables created! Now please delete this file.");
}
else {
echo("Tables created! This file has been deleted automatically for security reasons.");
}
?>
Just a nicer touch D:
Mr Macro
20-04-2007, 08:33 PM
Your going in the credits list xD tyvm :)
Progress:
Installer made, still to bee tested then BETA'd
Other pages need to be coded, tested then BETA'd
Don't get me started on graphics and public BETA
Invent
20-04-2007, 08:34 PM
Rofl, np.
No offense but.. You are making a forum but don't even know something simple like this...
Recursion
20-04-2007, 08:36 PM
<?PHP
require('includes/config.php');
for($K = 0; $K<sizeof($query); $K++)
{
$query = mysql_query($query[$K]) or die('Error: '. mysql_error());
chmod("install.php", 0777);
unlink("install.php");
if(file_exists("install.php")) {
echo("Tables created! Now please delete this file.");
}
else {
echo("Tables created! This file has been deleted automatically for security reasons.");
}
?>Just a nicer touch D:
Sometimes I wounder...
Why let PHP CHMOD the files to 777, if the CHMOD facility is to keep files 'safe'. lol
Invent
20-04-2007, 08:36 PM
I was going to say that Tom but I realised that isn't going to help him or this thread in anyway.
@Jaffa:
You are allowed to CHMOD to 0777 because a file's pemissions have to be set to 0777 for you to write to it or change its properties [:
Mr Macro
20-04-2007, 08:40 PM
The purpose of me doing it is to learn :) Thanks for your concern though.
Recursion
20-04-2007, 08:41 PM
Sometimes even the simplest thing, can be the hardest... :)
ScottDiamond
20-04-2007, 08:47 PM
No offense but.. You are making a forum but don't even know something simple like this...
Exactly what came to my negative mind tbh. :D
Sometimes even the simplest thing, can be the hardest... :)
You just said you're no expert, so why try to act smart about it?
Mr Macro
20-04-2007, 08:50 PM
Its easier to learn if your enjoying what your doing.I enjoy doing big projects like this.Not little forms and echoing Hello World xD
Invent
20-04-2007, 08:52 PM
Hello worlds are the best things you can EVER make ^^.
Mr Macro
20-04-2007, 08:56 PM
Lol xD
Agnostic Bear
20-04-2007, 09:15 PM
Would
if(mysql_query(); == TRUE)
{
Would that say if the query made the table or not ?
Dude thats a stupid way to do it and no it wouldn't work im 99.99% sure.
Just do:
$query = mysql_query() or die('Error: '. mysql_error());
echo("yayz it workd");
Slow way to do it.
So, this would work.
<?PHP
require('includes/config.php');
for($K = 0; $K<sizeof($query); $K++)
{
$query = mysql_query($query[$K];) or die('Error: '. mysql_error());
echo("Tables created.Now, delete this file.");
?>
(Variables being in the config page)
Too much crap
Here's how the Dan would do it:
if(@mysql_query("CREATE TABLE BLAH BLAH")) // use @ to suppress warnings.
{
yay kill me now it worked.
}
Mr Macro
20-04-2007, 09:24 PM
I'm making installer, so i need the crap.I need to loop through the queries to create all like 12 of them. xD Thanks anyway.
Dentafrice1
20-04-2007, 09:27 PM
TBH Mr. Macro, if you can't figure that out and you put the ; after $query, I don't see how you can make a forum?
Mr Macro
20-04-2007, 09:56 PM
Im learning...
See, I told you im no Expert :D
Can I ask why you replied to this thread then?
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.