PHP - Die(); Killing Whole Script *help Please*
Ok, what I want to happen is, if if($_POST['select'] == 'choose'){ is submitted, the script to display an error and not proccess anything after with the die(); message displayed to the user, but it's not showing the message, and infact when if($_POST['select'] is submitted as another array (I'm sorry, is that the correct term?) it still kills the whole script.
I've check in my db an nothing is updating the tables so I guess die is working to an degree. I've tried it without the die commands an it works as it should so I know the info does get sent without the die Here is my code so far - <?php /************************** database info ****************************/ $host = "***"; $user = "***"; $pass = "***"; $db = "***"; /**************************** define variables ****************************/ $name = $_POST['name']; $message = $_POST['message']; mysql_connect($host, $user, $pass) OR die ("Could not connect to the server."); mysql_select_db($db) OR die("Could not connect to the database."); // connect to server or die :( ?> <?php if(isset($_POST['submit'])) { if($_POST['select'] == 'choose'){ die("please select a shout or request from the drop down");// if no drop down is selected, kill the script and explain why } else if($_POST['select'] == 'shouts'){ // begin shouts $message = htmlspecialchars($message); $message = nl2br($message); $message = mysql_real_escape_string($message); $name = htmlspecialchars($name); $name = mysql_real_escape_string($name); $class = "shout"; // assigns the css class to be used when the results are called { mysql_query("INSERT INTO shoutbox (name, message, class) VALUES ('$name', '$message', $class)"); }} // begin request ?> <link href="css/vip_sheet.css" rel="stylesheet" type="text/css" /> <div id="shout-container"> <div id="shouts"> <?php $result = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 0,10"); while ($row = mysql_fetch_array($result)) { ?> <div class="<?php echo $row['class']; ?>"> <b><?php echo $row['name']; ?></b><br /> <?php echo $row['message']; ?></div> <?php }} ?> </div> </div> thank you Similar Tutorialswhy is it that i remove the / from the var slide and but it cuts of the sentence where the ' was at for example i wrote : It's very sunny out! and it just showed It what mistake did i do wrong Code: [Select] <?php if($_POST['submitbtn']){ require "scripts/connect.php"; $slide = mysql_real_escape_string($_POST ['slide']); $news = mysql_real_escape_string($_POST ['news']); if($news){ $query = mysql_query("UPDATE home SET `slide`='$slide',`news`='$news'"); echo "You have add successfully"; }else $msg = "News section must be filled!"; mysql_close(); } ?> <?php require "scripts/connect.php"; $query = mysql_query("SELECT * FROM home"); $rows = mysql_fetch_assoc($query); $slide = stripslashes($rows['slide']); $news = stripslashes($rows['news']); mysql_close(); ?> <form action='edithp' method='post'> <table> <tr> <td></td> <td><?php echo $msg;?></td> </tr> <tr> <td>Slider</td> <td><input type="text" name='slide' style="width:380px" value=<?php echo $slide;?> /></td> </tr> <tr> <td>News</td> <td><textarea cols='45' rows='20' name='news'><?php echo $news;?></textarea></td> </tr> <tr> <td></td> <td><input type='submit' name='submitbtn' value='SUBMIT'</td> </tr> </table> </form> Hey there everyone. Today isn't my lucky day since I'm dealing with international characters. (Arabic). What happens is the following: Arabic entered in form > saved to MySQL > Retrieved from MySQL > outputted as XML > used in an application (Google maps if it makes any difference). Plain and simple, the problem is that the final output is this: Code: [Select] %u0645%u0639%u0644%u0645 which definetly isn't arabic. What I've tried so far: - Loading the Google Maps thing directly from XML which I manually created and put the arabic chars into -> WORKED! (meaning I cut out the saving and retrieval of info from the db to see where the problem may be coming from) - Set the database collation and charset to utf8_unicode_ci. (Also collation of the fields inside the table) -> NO LUCK! - Tried encoding all PHP files and html files involved in the process to UTF-8 Code: [Select] <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">-> NO LUCK! - Tried a suggestion from Google which said try to execute this query after connection with the db: mysql_query("SET NAMES 'utf8'"); mysql_query('SET CHARACTER SET utf8'); -> still no luck First time I get that frustrated. I guess the problem isn't with Gmaps and XML. Something to do with PHP & MySQL because when the raw XML files displays correctly, Gmaps works like a charm. And the only way I got the XML file to show correctly as said earlier was to manually create it and enter the arabic text in it. Thanks a lot for any help provided! I have some OOP code im working on and I have some interactions with the database. However, mysql_fetch_array fails to be working. Have I missed something? Code: [Select] class core { var $array_batsmen = ''; var $array_bowlers = ''; // Query to get batsmen function get_batsmen() { return $this->array_batsmen = mysql_query('SELECT id, name, ability, strength FROM wtw_players WHERE team_id = 1 ORDER BY id ASC'); } // Query to get bowlers function get_bowlers() { $this->array_bowlers = mysql_query('SELECT id, name, ability, strength FROM wtw_players WHERE team_id = 2'); } // Generate array of batsmen to be used function generateBatsmen() { while ($array = mysql_fetch_array($this->array_batsmen)) { echo $array['name']; } } } The functions are called later normally, i've only included the necessary parts. Basically I have the var $array_batsmen which stores the mysql_query. This is then later used with a mysql_fetch_array to return names from the earlier query. But nothing happens! It doesn't return anything (don't worry, I have a return later on). The loop just doesn't seem to work :/ Hello Everyone, I am very very new to php, i recetly code some php script for my website, but now stuck with some horrible errors. At first the same scripts were running quite fine, but just today its start giving me erroe, i can't figure out whats the issue, i try to uninstall and install XAMPP again and again, configure php.ini file but still no result. following are the error message i am getting: Warning: include_once(C:/xampp/htdocs\include\search.php?start=0&page=0&product=black&cat=All Categories) [function.include-once]: failed to open stream: No error in C:\xampp\htdocs\initialsearch.php on line 6 Warning: include_once() [function.include]: Failed opening 'C:/xampp/htdocs\include\search.php?start=0&page=0&product=black&cat=All Categories' for inclusion (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\initialsearch.php on line 6 i also set the include path in php.ini , but its also not helped. It will be a great help if someone can help me to solve this issue. i am attaching following files alone : initialsearch.php search.php Also , i am running WINDOWS 7 and XAMPP 1.7.3 Waiting for some help thanks again. Hi I have 2 problems 1) I am making a script which will show NS records i.e. NS1 -- blah blah NS2 -- blah blah This is what I have done Code: [Select] $domain_name = $_POST[domainbox]; // From text Box $dns = dns_get_record($domain_name, DNS_NS); $ns_1 = $dns['0']; echo $ns_1['taget']; // This means NS1 = blah blah I did this because when we do echo of Code: [Select] $dns = dns_get_record($domain_name, DNS_NS), out put is Out put is Code: [Select] Array ( [0] => Array ( [host] => yourdomain.com [type] => NS [target] => ns1.yourdomain.com [class] => IN [ttl] => 70144 ) [1] => Array ( [host] => yourdomain.com [type] => NS [target] => ns2.yourdomain.com [class] => IN [ttl] => 70144 ) ) But it is not showing any output. My brain is screwed up, didnt found anything on google 2) If a domain have 4 or 8 i.e. more than 2 name servers, then how to do its output ? select_display.php // I am selecting an ID value from the db, result can only be 0 or 1 if (mysql_num_rows($result) == 0) { print '<big style="color: red;"><span style="font-weight: bold;"> ERROR MESSAGE:</span></big> Update ID number not found'; // I don't want my form to be displayed, just the error message } if (mysql_num_rows($result) == 1) { // Here I want to jump to html <form action="insert.php" method="post"> // I don't want to echo the whole form from within php // Now it displays on either compare because I am displaying it after ?> } Hello there
After a few years of spending less and less time coding, I've got a lot of catching up to do. Back when I left I usually would run without classes. Now this is a big deal for me today.
I do understand the concept of classes and already did some working models, mostly from my learning process.
Now here is what is bothering me:
<?PHP class database { // Variables public $test; // Constructor public function __construct() { $test = "4"; } // Functions // public function test() { var_dump($this->test); } } $test = new database; $test->test(); ?>Wether I run this script on itself, nor through another file, this does work. What i get is: NULL The constructor does run, I did an echo inside it. Also it does not matter if the variable is public, private or protected - it will be always NULL. Error_reporting is on E_ALL, does not show any errors. What have I overlooked? Hi everyone! I've been working on a php script to replace links that contain a query with direct links to the files they would redirect to. I'm having trouble echoing $year in my script. Listed below is the script, just below ,$result = mysql_query("SELECT * FROM $dbname WHERE class LIKE '%$search%'") or die(mysql_error());, in the script I try to echo $year. It doesn't show up in the table on the webpage. Everything else works fine. Any help wold be appreciated greatly. Thanks in advance. <?php include 'config2.php'; $search=$_GET["search"]; // Connect to server and select database. mysql_connect($dbhost, $dbuser, $dbpass)or die("cannot connect"); mysql_select_db("vetman")or die("cannot select DB"); $result = mysql_query("SELECT * FROM $dbname WHERE class LIKE '%$search%'") or die(mysql_error()); // store the record of the "" table into $row //$current = ''; echo "<table align=center border=1>"; echo "<br>"; echo "<tr>"; echo "<td align=center>"; ?> <div style="float: center;"><a><h1><?php echo $year; ?></h1></a></div> <?php echo "</td>"; echo "</tr>"; echo "</table>"; // keeps getting the next row until there are no more to get if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 2; echo "<table align=center>"; echo "<br>"; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; echo "<td align=center>"; ?> <div style="float: left;"> <div><img src="<?php echo $image1; ?>"></div> </div> <?php echo "</td>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i > 0) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; echo '</tr>'; } mysql_close(); ?> </table> Hi i have this upload script which works fine it uploads image to a specified folder and sends the the details to the database. but now i am trying to instead make a modify script which is Update set so i tried to change insert to update but didnt work can someone help me out please this my insert image script which works fine but want to change to modify instead Code: [Select] <?php mysql_connect("localhost", "root", "") or die(mysql_error()) ; mysql_select_db("upload") or die(mysql_error()) ; // my file the name of the input area on the form type is the extension of the file //echo $_FILES["myfile"]["type"]; //myfile is the name of the input area on the form $name = $_FILES["image"] ["name"]; // name of the file $type = $_FILES["image"]["type"]; //type of the file $size = $_FILES["image"]["size"]; //the size of the file $temp = $_FILES["image"]["tmp_name"];//temporary file location when click upload it temporary stores on the computer and gives it a temporary name $error =array(); // this an empty array where you can then call on all of the error messages $allowed_exts = array('jpg', 'jpeg', 'png', 'gif'); // array with the following extension name values $image_type = array('image/jpg', 'image/jpeg', 'image/png', 'image/gif'); // array with the following image type values $location = 'images/'; //location of the file or directory where the file will be stored $appendic_name = "news".$name;//this append the word [news] before the name so the image would be news[nameofimage].gif // substr counts the number of carachters and then you the specify how how many you letters you want to cut off from the beginning of the word example drivers.jpg it would cut off dri, and would display vers.jpg //echo $extension = substr($name, 3); //using both substr and strpos, strpos it will delete anything before the dot in this case it finds the dot on the $name file deletes and + 1 says read after the last letter you delete because you want to display the letters after the dot. if remove the +1 it will display .gif which what we want is just gif $extension = strtolower(substr($name, strpos ($name, '.') +1));//strlower turn the extension non capital in case extension is capital example JPG will strtolower will make jpg // another way of doing is with explode // $image_ext strtolower(end(explode('.',$name))); will explode from where you want in this case from the dot adn end will display from the end after the explode $myfile = $_POST["myfile"]; if (isset($image)) // if you choose a file name do the if bellow { // if extension is not equal to any of the variables in the array $allowed_exts error appears if(in_array($extension, $allowed_exts) === false ) { $error[] = 'Extension not allowed! gif, jpg, jpeg, png only<br />'; // if no errror read next if line } // if file type is not equal to any of the variables in array $image_type error appears if(in_array($type, $image_type) === false) { $error[] = 'Type of file not allowed! only images allowed<br />'; } // if file bigger than the number bellow error message if($size > 2097152) { $error[] = 'File size must be under 2MB!'; } // check if folder exist in the server if(!file_exists ($location)) { $error[] = 'No directory ' . $location. ' on the server Please create a folder ' .$location; } } // if no error found do the move upload function if (empty($error)){ if (move_uploaded_file($temp, $location .$appendic_name)) { // insert data into database first are the field name teh values are the variables you want to insert into those fields appendic is the new name of the image mysql_query("INSERT INTO image (myfile ,image) VALUES ('$myfile', '$appendic_name')") ; exit(); } } else { foreach ($error as $error) { echo $error; } } //echo $type; ?> hey guys im really just after a bit of help/information on 2 things (hope its in the right forum).
1. basically I'm wanting to make payments from one account to another online...like paypal does...im wondering what I would need to do to be able to do this if anyone can shine some light please?
2.as seen on google you type in a query in the search bar and it generates sentences/keywords from a database
example:
so if product "chair" was in the database
whilst typing "ch" it would show "chair" for a possible match
I know it would in tale sql & json but im after a good tutorial/script of some sort.
if anyone can help with some information/sites it would be much appreciated.
Thank you
Hello, I stored a fsockopen function in a separate "called.php" file, in order to run it as another thread when it needs. The called script should return results to the "master.php" script. I'm able to run the script to get the socket working, and I'm able to get results from the called script. I tried for hours but I can't do the twice both My master.php script (with socket working): Code: [Select] <?php $command = "(/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR] &) > /dev/null"; $result = exec($command); echo ("result = $result\r\n"); ?> and my called.php script Code: [Select] #!/mnt/opt/usr/bin/php-cli -q <?php $device = $_SERVER['argv'][1]; $port = "8080"; $fp = fsockopen($device, $port, $errno, $errstr, 5); fwrite($fp, "test"); fclose($fp); echo ("normal end of the called.php script"); ?> In the master script, if I use Code: [Select] $command = "(/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR] &) > /dev/null"; the socket works, but I have nothing in $result (note also that I don't anderstand why the ( ... &) are needed!?) and if I use Code: [Select] $command = "/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR]"; I have the correct text "normal end of the called.php script" in $result but the socket connection is not performed (no errors in php logs) Could you help me to find a way to let's work the two features correctly together? Thank you. I'm trying to use this script known as SimpleImage.php that can be found here <a href="http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php">link</a> I'm trying to include what is on the bottom of the page to my existing script can anyone help me I've tried several ways but its not working. Code: [Select] <?php session_start(); error_reporting(E_ALL); ini_set('display_errors','On'); //error_reporting(E_ALL); // image upload folder $image_folder = 'images/classified/'; // fieldnames in form $all_file_fields = array('image1', 'image2' ,'image3', 'image4'); // allowed filetypes $file_types = array('jpg','gif','png'); // max filesize 5mb $max_size = 5000000; //echo'<pre>';print_r($_FILES);exit; $time = time(); $count = 1; foreach($all_file_fields as $fieldname){ if($_FILES[$fieldname]['name'] != ''){ $type = substr($_FILES[$fieldname]['name'], -3, 3); // check filetype if(in_array(strtolower($type), $file_types)){ //check filesize if($_FILES[$fieldname]['size']>$max_size){ $error = "File too big. Max filesize is ".$max_size." MB"; }else{ // new filename $filename = str_replace(' ','',$myusername).'_'.$time.'_'.$count.'.'.$type; // move/upload file $target_path = $image_folder.basename($filename); move_uploaded_file($_FILES[$fieldname]['tmp_name'], $target_path); //save array with filenames $images[$count] = $image_folder.$filename; $count = $count+1; }//end if }else{ $error = "Please use jpg, gif, png files"; }//end if }//end if }//end foreach if($error != ''){ echo $error; }else{ /* -------------------------------------------------------------------------------------------------- SAVE TO DATABASE ------------------------------------------------------------------------------------ -------------------------------------------------------------------------------------------------- */ ?> Well the subject line is pretty explicit. I found this script that uploads a picture onto a folder on the server called images, then inserts the the path of the image on the images folder onto a VACHAR field in a database table. Code: [Select] <?php //This file inserts the main image into the images table. //address error handling ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); //authenticate user //Start session session_start(); //Connect to database require ('config.php'); //Check whether the session variable id is present or not. If not, deny access. if(!isset($_SESSION['id']) || (trim($_SESSION['id']) == '')) { header("location: access_denied.php"); exit(); } else{ // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif"); if (in_array($file['type'], $valid_types)) return 1; return 0; } // Just a short function that prints out the contents of an array in a manner that's easy to read // I used this function during debugging but it serves no purpose at run time for this example function showContents($array) { echo "<pre>"; print_r($array); echo "</pre>"; } // Set some constants // This variable is the path to the image folder where all the images are going to be stored // Note that there is a trailing forward slash $TARGET_PATH = "images/"; // Get our POSTed variable $image = $_FILES['image']; // Sanitize our input $image['name'] = mysql_real_escape_string($image['name']); // Build our target path full string. This is where the file will be moved to // i.e. images/picture.jpg $TARGET_PATH .= $image['name']; // Make sure all the fields from the form have inputs if ( $image['name'] == "" ) { $_SESSION['error'] = "All fields are required"; header("Location: member.php"); exit; } // Check to make sure that our file is actually an image // You check the file type instead of the extension because the extension can easily be faked if (!is_valid_type($image)) { $_SESSION['error'] = "You must upload a jpeg, gif, or bmp"; header("Location: member.php"); exit; } // Here we check to see if a file with that name already exists // You could get past filename problems by appending a timestamp to the filename and then continuing if (file_exists($TARGET_PATH)) { $_SESSION['error'] = "A file with that name already exists"; header("Location: member.php"); exit; } // Lets attempt to move the file from its temporary directory to its new home if (move_uploaded_file($image['tmp_name'], $TARGET_PATH)) { // NOTE: This is where a lot of people make mistakes. // We are *not* putting the image into the database; we are putting a reference to the file's location on the server $sql = "insert into images (member_id, image_cartegory, image_date, image) values ('{$_SESSION['id']}', 'main', NOW(), '" . $image['name'] . "')"; $result = mysql_query($sql) or die ("Could not insert data into DB: " . mysql_error()); header("Location: images.php"); echo "File uploaded"; exit; } else { // A common cause of file moving failures is because of bad permissions on the directory attempting to be written to // Make sure you chmod the directory to be writeable $_SESSION['error'] = "Could not upload file. Check read/write persmissions on the directory"; header("Location: member.php"); exit; } } //End of if session variable id is not present. ?> The script seems to work fine because I managed to upload a picture which was successfully inserted into my images folder and into the database. Now the problem is, I can't figure out exactly how to write the script that displays the image on an html page. I used the following script which didn't work. Code: [Select] //authenticate user //Start session session_start(); //Connect to database require ('config.php'); $sql = mysql_query("SELECT* FROM images WHERE member_id = '".$_SESSION['id']."' AND image_cartegory = 'main' "); $row = mysql_fetch_assoc($sql); $imagebytes = $row['image']; header("Content-type: image/jpeg"); print $imagebytes; Seems to me like I need to alter some variables to match the variables used in the insert script, just can't figure out which. Can anyone help?? How would I go about making it to where,, I can tell the script to use a certain extension of php in the script like curl.. ? Thanks I have an application which runs on more than one server and need to launch one PHP script from another PHP script. Since this is different than a function call I'm not sure how it's done. I plan to include parameters in the URL I send and use GETs to pick up parameters in the "called" PHP script. Thanks for sugestions Hi, I am trying to run two scripts on one page. When I use just one script on the page they work however when I place both scripts on the same page one of them disrupts the other script. This script prevents the other following script from working: Code: [Select] ini_set('display_errors', 1); error_reporting(-1); { $query = "SELECT * FROM answers ORDER BY `aid` DESC LIMIT 0, 11"; } $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $answer = $row['answer']; $aid = $row['aid']; echo " <div class='questionboxquestion'> <a href= 'http://www.domain.co.uk/test/easy/answer.php?aid=$aid' class='questionlink'>$answer</a> </div> <div class='questionboxnotes'> </br> </div> <div class='questionboxlinks'> <div class='questionboxcategory'> <div class='questionboxcategorytitle'> Category: </div> <a href= 'http://www.domain.co.uk/test/easy/furniture-category.php' class='questionanswerlink'></a> </div> <div class='questionboxanswerlink'> <a href= 'http://www.domain.co.uk/test/oeasy/index.php' class='questionanswerlink'>Answer</a> </div> </div> "; } Code: [Select] <?php if($error) echo "<span style=\"color:#ff0000;\">".$error."</span><br /><br />"; ?> <label for="username">Username: </label> <input type="text" name="username" value="<?php if($_POST['username']) echo $_POST['username']; ?>" /><br /> <label for="password">Password: </label> <input type="password" name="password" value="<?php if($_POST['password']) echo $_POST['password']; ?>" /><br /> <label for="password2">Retype Password: </label> <input type="password" name="password2" value="<?php if($_POST['password2']) echo $_POST['password2']; ?>" /><br /> <label for="email">Email: </label> <input type="text" name="email" value="<?php if($_POST['email']) echo $_POST['email']; ?>" /><br /><br /> <input type="submit" name="submit" value="Register" /> Below is a Log-Out Script that I wrote... <?php // Initialize a session. session_start(); // Access Constants require_once('../config/config.inc.php'); // Log Out User. $_SESSION['loggedIn'] = FALSE; // Redirect User. if (isset($_SESSION['returnToPage'])){ header("Location: " . BASE_URL . $_SESSION['returnToPage']); }else{ // Take user to Home Page. header("Location: " . BASE_URL . "index.php"); } // Destroy Session. session_destroy(); // Erase Session Cookie Contents. setcookie (session_id(), "", time() - 3600); // End script. exit(); ?> Questions: 1.) How does my code look? 2.) Does it provide a secure log out? 3.) I don't think the cookie part is working, because after I click "Log Out" on a web page, I looked at the Cookie in FireFox's Web Developer Toolbar, and there is still a value for the PHPSESSID?! Thanks, Debbie This code works:
How can I execute this in one script tag?
<script> var urlParams; (window.onpopstate = function () { var match, pl = /\+/g, // Regex for replacing addition symbol with a space search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, query = window.location.search.substring(1); urlParams = {}; while (match = search.exec(query)) urlParams[decode(match[1])] = decode(match[2]); })(); var a = urlParams["a"]; var b = urlParams["b"]; // var url = "http://example.com/tracker/"+ a +'/' + b; var iDiv = document.createElement('img'); iDiv.id = '5050'; iDiv.src = +url; iDiv.width = '14'; iDiv.height = '14'; document.getElementsByTagName('body')[0].appendChild(iDiv); iDiv.appendChild(innerDiv); </script> <script> document.getElementById("5050").src ="http://example.com/tracker/"+ a +'/' + b; </script> i have the following code... it works well in it's current position... $profile_sql="SELECT * FROM $tbl_12"; $profile_query = mysql_query($profile_sql); while($rs_profile = mysql_fetch_array($profile_query)){ $profile_ph = $rs_profile["ph"]; $profile_pm = $rs_profile["pm"]; } but if i put it in a function it gives me an error... like this... function get_profile() { $profile_sql="SELECT * FROM $tbl_12"; $profile_query = mysql_query($profile_sql); while($rs_profile = mysql_fetch_array($profile_query)){ $profile_ph = $rs_profile["ph"]; $profile_pm = $rs_profile["pm"]; echo $profile_pm; } } Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in... |