PHP - Problem With Mysqli_fetch_array
I HOPE THIS IS IN THE CORRECT FORUM! I am developing a program that filters a MySQL database to choose a type of verse. I am using an HTML form with check boxes to select the type. The variable that is passed using $POST is a text string. I am using this string to query the database in the table Events to get all of the verses with that Event_Type. Using mysqli_fetch_array, I am then extacting the ID to use in another MySQL query, this time querying the Verses table to list the verses of this type. What is actually happening is that all the types up to 9 are displaying the correct result, but the ones with ID 10 to 19 are displaying verses with ID = 1 and the last 3 are displaying versed with ID = 2. So it is obvious that it is only looking at the first digit of the ID. How do you get it to recognise complete ID number? PHP Version 5.3.6 Here is the PHP code: Code: [Select] <?php include("Loc_cverse_connect.php"); doDB(); //check for required info from the query string //verify the Event exists $verify_Event_sql = "SELECT ID, Event_Type FROM Events WHERE Event_Type = '".$_POST["Event_Type"]."'"; $verify_Event_res = mysqli_query($mysqli, $verify_Event_sql) or die(mysqli_error($mysqli)); echo $_POST["Event_Type"]; if (mysqli_num_rows($verify_Event_res) < 1) { //this Event does not exist $display_block = "<p><em>You have selected an invalid Event.<br/> Please try again.</em></p>"; } else { //get the Event ID while ($Event_info = mysqli_fetch_array($verify_Event_res)) { $Event_ID = stripslashes($Event_info['ID']); } //gather the Events $get_Event_sql = "SELECT ID, Verse FROM Verses WHERE Event = '".$Event_ID["ID"]."' ORDER BY ID ASC"; $get_Event_res = mysqli_query($mysqli, $get_Event_sql) or die(mysqli_error($mysqli)); //create the display string $display_block = " <p> The Event Type is <b>" .$_POST["Event_Type"]."</b> </p> <table width=\"50%\" cellpadding=\"3\" cellspacing=\"1\" border=\"1\" BGCOLOR=\"#87CEEB\" > <tr> <th>ID</th> <th>VERSE</th> </tr>"; while ($Verse_info = mysqli_fetch_array($get_Event_res)) { $Event_id = $Verse_info['ID']; $Verse_text = nl2br(stripslashes($Verse_info['Verse'])); //add to display $display_block .= " <tr> <td width=\"1%\" valign=\"top\">".$Event_id."<br/></td> <td width=\"35%\" valign=\"top\">".$Verse_text."<br/><br/> </tr>"; } //free results mysqli_free_result($get_Event_res); mysqli_free_result($verify_Event_res); //close connection to MySQL mysqli_close($mysqli); //close up the table $display_block .= "</table>"; } ?> <html> <head> <title> List of Verses</title> </head> <body BGCOLOR="#87CEEB"> <h1>Verses</h1> <?php echo $display_block; ?> </body> </html> mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $ MySQL Table Structu Event:- ID Event_Type Verses:- ID Event Sub_Type Verse Similar TutorialsHey everyone I've been working on converting my old mysql code to to the mysqli version and am running into some trouble. I am pulling posts form phpbb and displaying them in a script. My first script below works just fine. Code: [Select] <?php require("connect.php"); $query="SELECT * FROM phpbb_topics WHERE (forum_id='13' OR forum_id='14') AND topic_status = '0'"; $query2="SELECT * FROM phpbb_topics WHERE (forum_id='15' OR forum_id='16') AND topic_status = '0'"; $result=mysql_query($query); $result2=mysql_query($query2); echo "<table border=0 cellpadding=2>"; echo "<tr><td>Lost</td><td>Found</td></tr>"; while($row=(mysql_fetch_array($result)) || $row2=(mysql_fetch_array($result2))) { $forum_id=mysql_result($result,$k,"forum_id"); $topic_id=mysql_result($result,$k,"topic_id"); $topic_title=mysql_result($result,$k,"topic_title"); $forum_id2=mysql_result($result2,$k,"forum_id"); $topic_id2=mysql_result($result2,$k,"topic_id"); $topic_title2=mysql_result($result2,$k,"topic_title"); echo "<tr><td width='15%'><a href=/sahbb/viewtopic.php?f=$forum_id&t=$topic_id>$topic_title</a></td> <td width='15%'><a href=/sahbb/viewtopic.php?f=$forum_id2&t=$topic_id2>$topic_title2</a></td> </tr>"; $k++; } echo "</table>"; mysql_close($connect); ?> however its not very clean or memory efficient so i have converted it to the following. Code: [Select] <?php require("includes_database/mysqli_connect.php"); $query="SELECT * FROM phpbb_topics WHERE (forum_id='13' OR forum_id='14')"; $query2="SELECT * FROM phpbb_topics WHERE (forum_id='15' OR forum_id='16')"; $result=mysqli_query($dbc, $query); $result2=mysqli_query($dbc, $query2); echo "<table border=1 cellpadding=2>"; echo "<tr><td>Lost</td><td>Found</td></tr>"; while(($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) || ($row2 = mysqli_fetch_array($result2, MYSQLI_ASSOC))) { echo "<tr><td width='15%'><a href=/sahbb/viewtopic.php?f=".$row['forum_id']."&t=".$row['topic_id'].">".$row['topic_title']."</a></td> <td width='15%'><a href=/sahbb/viewtopic.php?f=".$row2['forum_id']."&t=".$row2['topic_id'].">".$row2['topic_title']."</a></td> </tr>"; } echo "</table>"; mysqli_free_result($result); mysqli_free_result($result2); mysqli_close($dbc); ?> I know the error is in my while loop but i cant seem to figure out exactly where. The new code displays all of the first query in the table and then below that it displays the next query insted of displaying them side by side below would be an example of what is happening [table Lost Found Lost, Australian Sheppard Lost German Shepherded / Collie Mix Lost Golden Retriever/Cocker Mix Lost Female Grey Tiger Lost Pitbull Mix Lost 2 Chihuahua Lost Black Lab Lost - German Shepard Mix and Lab Mix Lost - Female German Sheperd Aprox 8 Week Old Kitten Found! 2 Pugs FOUND Found 1 Corgi female/ 1 Shih Tzu male Found Tan and Black Australian Shepard Found Australian Shepard Found Intact Male Pitbull/Lab Mix Any help that any of you could provide would be greatly appreciated! Hello, So I have only been using php for a few months now and am a noob. This question is probably an easy fix. My problem is that I have an array of info which is user stories they post on my site. I have a delete button for each story for the user to delete the associated story if they wish. The problem is that the delete button code deletes the last $row or story that was fetched! It seems that the variable updates through every loop and the code just deletes that id. Here is my code. Code: [Select] //page with delete button echo "<center><b>Stories Shared</b></center>"; $result = mysqli_query($cxn, "SELECT * FROM Stories WHERE User = '$name' ORDER BY ID DESC"); while($row = mysqli_fetch_array($result)) { if (empty($row)) { echo "<center>N/A</center>"; } $artpixname = $row['Artpixname']; echo "<hr />"; echo "<div id = 'info'>";; echo "ID: " . $row['ID']; echo "<b>Category: </b>" .$row['Type']. " "; $id = $row['ID']; echo "<FORM ACTION='delete.php' METHOD='POST'> <input type='hidden' name='ID' value='$id'> <INPUT TYPE = 'Submit' name='Delete' id='Delete' VALUE = 'Delete'>"; echo "<center><b><h3>" . $row['Name'] . "</h3></b></center> "; echo "</div>"; if (!empty($artpixname)) { echo "<center><img class = 'artimg' src = 'articles/images/".$row['Artpixname']."'></center>"; } echo "<br />"; echo "<br />"; echo $row['Article']; echo "<br />"; echo "<br />"; //now the delete button opens up the delete program here... <?php session_start(); include 'header.php'; include 'connection.php'; $id = $_POST['ID']; $name = $_SESSION['logname']; $result = mysqli_query($cxn, "SELECT ID FROM Stories WHERE ID = '$id'"); while($row = mysqli_fetch_array($result)) { $sql = mysqli_query($cxn, "DELETE FROM Stories WHERE ID = '$id'"); } echo "Your story was deleted successfully!"; echo "<br />"; echo "Click <a href = 'userpage.php?'.$name'><b>Here</b></a> to return to your profile page."; ?> What am I doing wrong? I tried everything including different variables and even putting the delete query in the while loop. Any help would be appreciated thanks! Lance MOD EDIT: [code] . . . [/code] tags added. I think I put this in the wrong forum, as it seems to be more of a php problem (I think) I'm trying to populate a profile page with information from the database. Really bizarrely, every $row variable that isn't null returns as 'website', which is the database username. I have absolutely no idea why this is. It might be worth noting I have just changed hosts...the only thing I can think might make a difference. Any help would be great, thankyou $query = "SELECT * FROM member WHERE username='$member'"; $result = mysqli_query ($dbc, $query) or trigger_error ("query: $query\n<br />MySQL Error: " . mysqli_error($dbc)); if ($result) { while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $member_id = $row['member_id']; $username = $row['username_id']; $photo = $row['photo']; $about = $row['about']; $slink = $row['soundcloud_link']; $mlink = $row['mixcloud_link']; $flink = $row['facebook_link']; $dlink = $row['divshare_link']; $mylink = $row['myspace_link']; $plink = $row['postbocks_links']; $website = $row['personal_website']; $type = $row['member_type']; $status = $row['status']; } } } I've echo'd the $query and put the result into sql directly and it comes out fine. Hi Guys Using mysqli_fetch_array(), which i had anticipated would simply return a numeric array with all the results from the simple query. However, it keeps coming out as a multidimensional array, which isn;t what i want. Is this just how it works or have i done something wrong? Code Code: [Select] $mysqli = new mysqli("localhost", "root", "", "ik"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $qry = "SELECT amount FROM teams"; $result = $mysqli->query($qry); while($row = mysqli_fetch_array($result, MYSQLI_NUM)) { $rows[] = $row; //echo $row . "<br/>"; } print_r($rows); Result Code: [Select] Array ( [0] => Array ( [0] => 3 ) [1] => Array ( [0] => 25 ) [2] => Array ( [0] => 26 ) [3] => Array ( [0] => 31 ) [4] => Array ( [0] => 34 ) [5] => Array ( [0] => 44 ) [6] => Array ( [0] => 50 ) [7] => Array ( [0] => 56 ) [8] => Array ( [0] => 65 ) [9] => Array ( [0] => 221 ) [10] => Array ( [0] => 222 ) [11] => Array ( [0] => 225 ) [12] => Array ( [0] => 2210 ) [13] => Array ( [0] => 2600 ) ) Hi guys, I received an error, could anyone explain this current error? Thanks Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in D:\inetpub\vhosts\championtutor.com\httpdocs\questionnaire.php on line 32 Hello im geting this error what im ding wrong? Code: [Select] PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/admincom/public_html/tsue/library/plugins/movie_plugin.php on line 7 line 7 is: while ($row = mysqli_fetch_array($sql)) { code he Code: [Select] $query = mysqli_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); $sql = mysqli_query($query, "SELECT `membername`, `filename`, `tid`, `info_hash`, `name`, `description`, `cid`, `size`, `added`, `leechers`, `seeders`, `times_completed`, `owner`, `options`, `nfo`, `sticky`, `flags`, `mtime`, `ctime`, `download_multiplier`, `upload_multiplier` FROM `tsue_members`, `tsue_torrents`, `tsue_attachments` WHERE `memberid`='owner' AND `content_type`='torrent_images' AND `content_id` = `tid` LIMIT 0, 10"); while ($row = mysqli_fetch_array($sql)) { $movie_plugin_row = ''; $uploader = $row['membername']; $description= $row['description']; $dydis= $row['size']; $name= $row['name']; $leechers= $row['leechers']; $owner= $row['owner']; $filename= $row['filename']; $nunx= $row['tid']; $seeders= $row['seeders']; eval("\$movie_plugin_row = \"".$TSUE['TSUE_Template']->LoadTemplate('movie_plugin_row')."\";"); $movie_plugin .= $movie_plugin_row; } Hi
I am a student who is fairly new to PHP and MySQL. I have been working on creating a registration page for a website and I'm getting the following warnings when I've tested the page:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/ed12e2w/public_html/COMM2735/dynamic_website/registration.php on line 74 Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, boolean given in /home/ed12e2w/public_html/COMM2735/dynamic_website/registration.php on line 80 I think that my query has failed but I'm not completely sure on what to change in order to solve this. Here is the section of code I'm having problems with: Attached Files register.php 733bytes 4 downloads Someone help me in this problem please?? Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in line 8 $rec= mysqli_query ($db, "SELECT FROM joborder WHERE id=$id"); $record = mysqli_fetch_array ($rec); // line 8 $fnames= $record ['fnames'] ; Edited March 8 by keiWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/myritebook/public_html/footer.php on line 13 I am trying to fix the above error. Please Help. code is given below:
<?php
if ($conn) {
try{
catch(Exception $e){ Guys thanks for helping me solve the problem i had but now i have another problem and i am lost. i have included the code below for you to have overview.
This is the code:
<table style="width:100%; margin-left:auto; margin-right:auto"> Hi, i use mysql_real_escape_string() function when insert in db, but when echo i use htmlentities($var, ENT_QUOTES, "UTF-8") Now problem is '\ in that text. In db it write text with single quote with \, example That\'s wrong, and when echo it show just the same like in db.. How can i fix this ? Hi there, I have a map of America made in flash, where you click on a state and the page should display the SQL database information for that state in the HTML table - but instead all it shows is the first entry of the database regardless of which state you click and it doesn't display the 2 radio buttons. My code is as follows Flash Actionscript 3 (just showing one state) Code: [Select] function waClick(event:MouseEvent):void { var waURL:URLRequest = new URLRequest("restaurants.php?state=Washington"); navigateToURL(waURL, "_self"); } wa_btn.addEventListener(MouseEvent.CLICK, waClick); PHP code Code: [Select] <?php include("mvfconnect.php"); $theChoice = $_GET['state']; $query = "SELECT * FROM restaurants WHERE" .$theChoice; $result = @ mysql_query($query); if (!$result) { $message="Unfortunately we are having problems with this page, we promise to have it fixed as soon as possible"; die($message); } $num = mysql_num_fields($result); $i=0; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $show1=substr($row['state'],0,50)."..."; $show2=substr($row['city'],0,50)."..."; $show3=substr($row['rname'],0,50)."..."; $show4=substr($row['address'],0,50)."..."; $show5=substr($row['pnum'],0,50)."..."; $show6=substr($row['web'],0,50)."..."; $show7=substr($row['dishes'],0,50)."..."; $show8=substr($row['dish_details'],0,50)."..."; $show9=substr($row['challenges'],0,50)."..."; $show10=substr($row['challenge_details'],0,50)."..."; $show11=substr($row['youtube'],0,50)."..."; $show12=substr($row['images'],0,50)."..."; echo "<tr>". "<td>".$row['city']."</td>". "<td>".$row['rname']."</td>". "<td>".$row['address']."</td>". "<td>".$row['pnum']."</td>". "<td>".$row['web']."</td>". "<td>".$row['dishes']."</td>". "<td>".$row['challenges']."</td>". "<td id='state".$i."' style='display:none'>".$row['state']."</td>". "<td id='city".$i."' style='display:none'>".$row['city']."</td>". "<td id='rname".$i."' style='display:none'>".$row['rname']."</td>". "<td id='address".$i."' style='display:none'>".$row['address']."</td>". "<td id='pnum".$i."' style='display:none'>".$row['pnum']."</td>". "<td id='web".$i."' style='display:none'>".$row['web']."</td>". "<td id='dishes".$i."' style='display:none'>".$row['dishes']."</td>". "<td id='dish_details".$i."' style='display:none'>".$row['dish_details']."</td>". "<td id='challenges".$i."' style='display:none'>".$row['challenges']."</td>". "<td id='challenge_details".$i."' style='display:none'>".$row['challenge_details']."</td>". "<td id='youtube".$i."' style='display:none'>".$row['youtube']."</td>". "<td id='images".$i."' style='display:none'>".$row['images']."</td>". "<td><input type='radio' name='vid' id='vid".$i."' onclick='openVideo(".$i.")' /></td>". "<td><input type='radio' name='pic' id='pic".$i."' onclick='openImage(".$i.")' /></td>". "<td class='last'style='display:none'>".$show1." ".$show2." ".$show3." ".$show4." ".$show5." ".$show6." ".$show7." ".$show8." ".$show9." ".$show10."</td>". "</tr>"; $i++; } ?> I have used this code before and it has worked fine, can someone please help me out! Okay, so i'm using the basic php mysql insert into function but I have a strange (or maybe not so strange, I just don't get it..) problem.. I have two columns (do you call them columns? I don't really know for sure, whatever things that are in a table whatsoever). Name and Trailer. EDIT: they are TEXT's if that matters Name is really nothing important, just the name. But I want to embed trailers.. If I embed the Megavideo code below: Code: [Select] <object width="400" height="300"><param name="movie" value="http://www.megavideo.com/v/8UZFURZQ2b55ada04d73ae65c726a5383b9ee9d9"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/8UZFURZQ2b55ada04d73ae65c726a5383b9ee9d9" type="application/x-shockwave-flash" allowfullscreen="true" width="400" height="300"></embed></object> Everything works fine, no problems and no bullshit. But.. if I for an example try to embed this one (NovaMov): Code: [Select] <iframe style='overflow: hidden; border: 0; width: 400px; height: 300px' src='http://embed.novamov.com/embed.php?width=400&height=300&v=xngq7u8yejwbt' scrolling='no'></iframe> It doesn't work. It just doesn't insert. Is inserting an "iframe" a problem or something? I just don't get why the hell it would do this? Does anyone know anything about this? If so i'd be eager and very thankful to hear why and how to fix it. thanks in advance Code: [Select] <?php require('config.php'); $sql = "SELECT m.Title as title , f.Reg_URL as reg FROM website_main as m JOIN website_front as f LIMIT 0,01 "; $result = @mysql_query($sql) or die(mysql_error()); echo "<table border='3'>"; echo "<font size='9'><tr> <th><FONT COLOR=red><center>Title</center></font></th> <th><FONT COLOR=red>reg</th> </tr></font>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table $reg = $row['reg']; echo "<tr><td bgcolor=''><center>"; echo $row['title']; echo "</td><td bgcolor=''><center>"; echo '.$reg.'; echo "</td></tr>"; } ?> I got a problem i try to use an attribute for $reg but only appears as .$reg. on website anyone know why? Parts i have problems with are $reg = $row['reg']; and echo '.$reg.';. thank you Elo, I'm creating a very simple image list that is function generated which pulls the source from a table in my database, this is my code Code: [Select] $output = "<ul>"; $img_src = get_all_image_src($sel_event['id']); while($src = mysql_fetch_array($img_src)) { for($i=0;$i <= 9; $i++) { $output .= "<li>"; $output .= "<a"; $output .= " class ='album'"; $output .= " rel='group'"; $output .= " href='/images/gallery/'" . $src['img_src'] . $i; $output .= ".jpg"; $output .= " title='sample 1'"; $output .= ">"; //Image Thumb $output .= "<img"; $output .= " src='/images/gallery/'"; $output .= $src['img_thumb_src']. $i . ".jpg"; $output .= "alt='image01' "; $output .= "title='sample title' />"; $output .= "tae"; $output .= "</a>"; $output .= "</li>"; } } $output .= "</ul>"; return $output; and the img src doesnt seems to add up... my folder structure is Sandbox>image>gallery>2011>Mall>Event>Thumbs where Sandbox is the main directory. i tried echoing the $src['img_src'] and it displays correctly the data to be added (which is 2011/Mall/Event/ plus $i and a .jpg) .. sorry noob here... any thoughts? am i missing a simple detail? I do not receive email for my published php file which is: <?php ///// easend.php ///// $youremail = "acdelco40108@yahoo.com"; /*put the email address here, between quotes, the email address you want the message sent to*/ $to = $youremail; $email = $_POST['EMail']; $name2 = $_POST['Name']; $street2 = $_POST['Street']; $city2 = $_POST['City']; $state2 = $_POST['State']; $zip2 = $_POST['Zip']; $Phone = $_POST['Home_Phone']; $Cell = $_POST['Cell_Phone']; $education = $_POST['email1']; $comments = $_POST['email2'] ; $headers = "From:" . $email; $fields = array(); $fields{"Name"} = "Name"; $fields{"Street"} = "Street"; $fields{"City"} = "City"; $fields{"State"} = "State"; $fields{"Zip"} = "Zip"; $fields{"Home_Phone"} = "Home Phone"; $fields{"Cell_Phone"} = "Cell Phone"; $fields{"EMail"} = "Email"; $fields{"email1"} = "Education"; $fields{"email2"} = "Comments"; $subject = "We have received the following information from your employment application"; $body = "We have received the following information from your employment application:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); } mail ($to, $subject, $body, $headers); //send mail to owner #end create email vars $headers = "From:" . $to; mail ($email, $subject, $body, $headers); //send mail to user #end create email vars echo "<head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"2; URL=ThankYou.html\"></head>"; ?> Hi. I am from poland. I am 17 old age and like webmastering. I write my social network. I have new server 10 GB VPS and my script no runing In my server. in my server do can not login. No runing function Code: [Select] mb_strtolower();as delete function mb_strtolower() ; this login runing. In my server haven`t installing liberary GD and no runing upload avatars. my code upload is: elseif ($_GET['act'] == "upload") { echo <<< KONIEC <hr> <center> <p> <h2>Dodaj zdjęcie</h2> <ul class="gallery clearfix"> <li class="extra"> KONIEC; error_reporting(E_ALL); // we first include the upload class, as we will need it here to deal with the uploaded file include('include/class.upload.php'); // retrieve eventual CLI parameters $cli = (isset($argc) && $argc > 1); if ($cli) { if (isset($argv[1])) $_GET['file'] = $argv[1]; if (isset($argv[2])) $_GET['dir'] = $argv[2]; if (isset($argv[3])) $_GET['pics'] = $argv[3]; } // set variables $dir_dest = (isset($_GET['dir']) ? $_GET['dir'] : 'test'); $dir_pics = (isset($_GET['pics']) ? $_GET['pics'] : $dir_dest); if (!$cli) { } // we have three forms on the test page, so we redirect accordingly if ((isset($_POST['action']) ? $_POST['action'] : (isset($_GET['action']) ? $_GET['action'] : '')) == 'simple') { // ---------- SIMPLE UPLOAD ---------- // we create an instance of the class, giving as argument the PHP object // corresponding to the file field from the form // All the uploads are accessible from the PHP object $_FILES $handle = new Upload($_FILES['my_field']); // then we check if the file has been uploaded properly // in its *temporary* location in the server (often, it is /tmp) if ($handle->uploaded) { // yes, the file is on the server // now, we start the upload 'process'. That is, to copy the uploaded file // from its temporary location to the wanted location // It could be something like $handle->Process('/home/www/my_uploads/'); $handle->Process($dir_dest); function TestProcess(&$handle, $title = 'test', $details='') { global $dir_pics, $dir_dest; $unlink = 'test/'. $handle->file_dst_name; $myid = $_SESSION['id']; $opis = htmlspecialchars(stripslashes(strip_tags(trim($_POST["opis"]))), ENT_QUOTES); $handle->Process($dir_dest); if ($handle->processed) { unlink("$unlink"); $link = ''.$dir_pics.'/' . $handle->file_dst_name .''; $addphoto = mysql_query("INSERT INTO photo VALUES('', '$myid', '$link', '$opis')"); echo <<< KONIEC <br> <center> <img src="$link" > <br> <br /> </center> KONIEC; } else { echo '<fieldset class="classuploadphp">'; echo ' <legend>' . $title . '</legend>'; echo ' Error: ' . $handle->error . ''; if ($details) echo ' <pre class="code php">' . htmlentities($details) . '</pre>'; echo '</fieldset>'; } } if (!file_exists($dir_dest)) mkdir($dir_dest); // ----------- $handle->image_convert = 'jpg'; $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 500; $handle->image_precrop = 15; $handle->image_watermark = "watermark_large.png"; $handle->image_watermark_x = 20; $handle->image_watermark_y = -20; TestProcess($handle, '15px pre-cropping (before resizing 800 wide), large watermark automatically reduced, position 20 -20', "\$foo->image_convert = 'jpg';\n\$foo->image_resize = true;\n\$foo->image_ratio_y = true;\n\$foo->image_x = 800;\n\$foo->image_precrop = 15;\n\$foo->image_watermark = 'watermark_large.png';\n\$foo->image_watermark_x = 20;\n\$foo->image_watermark_y = -20;"); } else { // one error occured echo '<fieldset>'; echo ' <legend>file not uploaded to the wanted location</legend>'; echo ' Error: ' . $handle->error . ''; echo '</fieldset>'; } // we copy the file a second time // we delete the temporary files $handle-> Clean(); } else { // if we are here, the local file failed for some reasons echo '<fieldset>'; echo ' <legend>local file error</legend>'; echo ' Error: ' . $handle->error . ''; echo '</fieldset>'; } echo <<< KONIEC <li> </ul> </p> </center> KONIEC; is it the only problem that isn`t installing GD as i have something off in php.ini ? Plise Help me i'm getting this erro "Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 3 in /***/***/*****.php on line 278 not an active session, starts new" this is the code: if ($phase = mysql_result(mysql_query("SELECT `phase` FROM `as_support` WHERE `mission` = '$var2'"),0,0)) { if ($phase=='5') { // mysql_query("DELETE FROM `as_support` WHERE `mission` = '$var2'"); // header("Location: https://www.**********/*******/*******.php"); } else { echo date('h:i:s') . ": PHASE is $phase<br />"; echo "\$var1=$var1,\$var2=$var2<br />"; } } else { echo "not an active session, starts new<br />"; echo "\$var1=$var1,\$var2=$var2<br />"; mysql_query("INSERT INTO `as_support` (`mission`, `phase`) VALUES ('$var2', '0')") OR DIE(mysql_error()); the first line is line no. 278 can someone please tell me what to do? tnx shirley Hi, im creating a script for a website that will list products, i have the basic construct which lists the products from the database but it lists then vertically, i have set the width of each 'product' to 200px so i could have around 3 colums and many rows. can anybody advise how i would make them run vertically aswell as horizontally? my code below: <?php include_once("include/globals.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="styles/stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="main"> <?php //Get database Results $result = mysql_query("SELECT * FROM Products WHERE is_active = 1") or die(mysql_error()); //keeps getting the next row until no more records while($row = mysql_fetch_array($result)) { //echo results ($result) echo '<div id="holder">'; echo '<div class="title">' . $row['Name'] . '</div>'; //insert image here echo '<div class="image">'; echo '<img src="' . $row['image'] . '" width="100" alt="">'; echo '</div>'; echo '<div class="tag_line">'; echo $row['Tag_Line']; echo '</div>'; echo '<div class="price">Now Only: £'; echo $row['Website_Price']; echo '</div>'; echo '<div class="prod-footer"></div>'; echo '</div>'; } ?> </div> </body> </html> table structu Field Type Null Default Comments MIME ID int(11) No product_code varchar(255) No Name varchar(255) Yes NULL Tag_Line varchar(255) Yes NULL Description varchar(255) Yes NULL Specification varchar(255) Yes NULL Technical_Info varchar(255) Yes NULL Cost_Price_USD decimal(10,2) Yes NULL Cost_Price_GBP decimal(10,2) Yes NULL Built_in_delivery decimal(10,2) Yes NULL Trade_Price decimal(10,2) Yes NULL Trade_Plus_Price decimal(10,2) Yes NULL Website_Price decimal(10,2) Yes NULL Is_active int(1) No image varchar(255) Yes NULL |