Good day to you all, I ham having an issue the the following error (Fatal error: Call to a member function fetch_result() on a non-object in on line 167) which is the while ($row = $result->fetch_object()) every way I try to change this another error crops up. If yo can find the time to assist me, it would be appreciated. Thanks in advance connection page <?php $dbhost = "xxxxx"; $dbuser = "xxxx"; $dbpass = "xxxxxx"; $dbname = "xxx"; $mysqli = new mysqli($dbhost, $dbuser, $dbpass,$dbname) or die ("Error connecting to database"); if ($mysqli->connect_errno){ printf("Connection failed: %s\n", $mysqli->connect_error); exit(); } ?> Index …

Member Avatar
Member Avatar
+0 forum 8

hi, i have an import csv script but it does not get entered into the database. only "uploaded successfully" and the data is echoed but nothing in the database is something wrong with it? and is it sql injection safe? <?php if(isset($_SESSION['sess_user_id'])) { if (isset($_POST['ubmit'])) { require "connection.php"; $session = $_SESSION['sess_user_id']; if (is_uploaded_file($_FILES['csv']['tmp_name'])) { echo "<h1>" . "File ". $_FILES['csv']['name'] ." uploaded successfully." . "</h1>"; echo "<h2>Displaying contents:</h2>"; readfile($_FILES['csv']['tmp_name']); } //Import uploaded file to Database $handle = fopen($_FILES['csv']['tmp_name'], "r"); $import=$dbh->prepare("INSERT INTO contact1( user_id, salutation, fname, lname, dob, house, mobile, office, email, spouse_name) VALUES(?,?,?,?,?,?,?,?,?,?"); while (($data = fgetcsv($handle, 1000, ",")) !== …

Member Avatar
Member Avatar
+0 forum 10

Hello I am able to display the images that i am retrieving from the database as a list. But i want to know how i will be able to display the same images as a grid or table. I have posted my code below.Can you please let me know how to alter the code to get it in a griew or table format. Any help will be appreciated. booklist.php <?php $database="login"; $con=mysql_connect("localhost","root",""); if(!$con) { die('could not connect'.mysql_error()); } mysql_select_db("$database",$con); echo "Connection established"; $query = ("SELECT * FROM Books"); $result = mysql_query($query); while($dog = mysql_fetch_array($result)){ $petname = $dog ['BookName']; echo "<P>" …

Member Avatar
Member Avatar
+0 forum 1

Hi there, I have a problam with my code, and i cant fix it, please help. The problam is with the mysql_num_rows on line 4 ; Here is the code: $sql_query = mysql_query("SELECT * FROM upload WHERE MATCH(username,text) AGAINST('$search_term')"); //additional check. Insurance method to re-search the database again in case of too many matches (too many matches cause returning of 0 results) if($results = mysql_num_rows($sql_query) != 0) //Error on this line !!!! { $sql = "SELECT * FROM upload WHERE MATCH(username,subject) AGAINST('$search_term') LIMIT $first_pos, $RESULTS_LIMIT"; $sql_result_query = mysql_query($sql); } Thanks for your help!

Member Avatar
Member Avatar
+0 forum 8

hi i am working on a project:auto parts web store With installation and I do not know where and how to start؟ help me

Member Avatar
Member Avatar
+0 forum 4

I am converting a PHP application from MySQL to PostgresSQL. The MySQL works flawlessly. The database for this application is a one to many relationship. I have a while loop nested inside another while loop <?php while ($movie_row = pg_fetch_array($movie, PGSQL_ASSOC)) { ?> [html code to echo various elements of $movie_row] [a record in this part will have multiple records of information from another table in the db which the following code will fetch and process] <?php $movie_file_result = pg_query ($conn, "SELECT DISTINCT(cd_name) FROM movie_files WHERE data_id=".$movie_row[id]." ORDER BY cd_name");?> <div class="files"> <p>Find in:</p> <ul class="file_list"> <?php while ($filesrow = …

Member Avatar
Member Avatar
+0 forum 3

I am converting a traditional website to WordPress for an animal rescue charity so members can have a blog and more easily update various pages. All has gone well but I am stuck on one key aspect. Viewers of the original site can click on a page that will then display pictures and names of all dogs of a certain size awaiting adoption. The dogs' names and the location of their photos are stored in a database and the photos in a folder. The images are **clickable** so that the user can pick a dog and see more about it …

Member Avatar
Member Avatar
+0 forum 5

I am new to php and mysql I want to crate a query that does the update or adds a new table if it is not in database. I get on else for echo: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/public_html/shop/dokumenti/up2.php on line 53 ID 1 ne postoji u drugoj tablici i trenutno: 0 – And I cannot insert a querry Can you help me with this code: <?php $mysql_db = ""; $mysql_user = ""; $mysql_pwd = ""; $con = mysql_connect("localhost", $mysql_user, $mysql_pwd); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($mysql_db, …

Member Avatar
Member Avatar
+0 forum 13

I'm making a B2B portal that can see just loggedin business customers that I add to base, I finished almost all, but there is one problem. When customer add some goods to his cart, goes to checkout and confirm his order he will have a link to invoice.php?ids=156 and that will appers just in his profile and not in profile of other customers but if he change ids number like this invoice.php?ids=150 he will see content although he did not create that purchase. This is not a big problem if someone does not try to change ids of invoice.php and …

Member Avatar
Member Avatar
+0 forum 3

I have two pages one called upload-file.php, this page uploads the image into the database and my folder. My PHP page looks like this. if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) { $insert=mysql_query("insert into match_item_image set item_id='".$_SESSION["session_temp"]."', image='".$name."', adid='$adid'") or die(mysql_error()); $cc=mysql_insert_id(); echo "success".$cc; My other page consist of a javascript function which displays my images upon upload. The problem I am having is that I need to change the image name when uploading it into my folder. I was able to change the image name but when I upload the image it displays blank because the JavaScript function Is looking for the original …

Member Avatar
Member Avatar
+0 forum 1

I have two pages one called upload-file.php, this page uploads the image into the database and my folder. My PHP page looks like this. if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) { $insert=mysql_query("insert into match_item_image set item_id='".$_SESSION["session_temp"]."', image='".$name."', adid='$adid'") or die(mysql_error()); $cc=mysql_insert_id(); echo "success".$cc; My other page consist of a javascript function which displays my images upon upload. The problem I am having is that I need to change the image name when uploading it into my folder. I was able to change the image name but when I upload the image it displays blank because the JavaScript function Is looking for the original …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to make multiplication in web shop that will show real price: **discount * tax * product price * 1 piece= real price** But I just don't know how to do it, I try 1 million things, spend about 48h just to make it, but, without success, no matter that is not surprising, I'm not a PRO. I hope someone will help me to finally finish this. My tables names: **Table "Products" - Structure "Product_price" //** That is Product price (it's normal number) **Table " _config" / Param "tax"** // That is Tax (it's percent (%)) **Table " Products" …

Member Avatar
Member Avatar
+0 forum 9

Hi, I'm sorry if this is answered already but I'm such a newbie at programming that I apperantly can't formulate my problem to find an answer! :-/ Here goes: I have a table filled with data. I want a user to be able to select via a dropdown list what row he/she wants to look at. So when an option is selected in the dropdown i want one div showing the first ten columns wich are descriptives of that row. then in the next div below i want the next ten columns listed. I woud then want if possible have …

Member Avatar
Member Avatar
+0 forum 3

Hello, can some one help me with the below code? I am trying to create a multiple image upload form that displays the images. I want to save the image name into my msql database and save the actual image into a folder in my dirrectory. <?php define('UPLOAD_PATH', $_SERVER['DOCUMENT_ROOT'] . '/upload/'); define('DISPLAY_PATH', '/upload/'); define('MAX_FILE_SIZE', 2000000); $permitted = array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif'); if (isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; // get the file extension $ext = substr(strrchr($fileName, "."), 1); // generate the random file name $randName = md5(rand() * time()); // image name …

Member Avatar
Member Avatar
+0 forum 6

Hi All, I am trying to create a page were users can edit their post. -Select subbmitted data from the database using post id, and display this information so that users can Edit. -And finally i want to update the data and continue to the preview page, where users can preview their post.

Member Avatar
Member Avatar
+0 forum 4

Hi I am running the following SQL (extract shown below) INSERT INTO users (user_id, username, username_clean) SELECT member_id, username, lower(REPLACE(username, '.', '_')) FROM members The problem arises when lower(REPLACE(username, '.', '_')) produces a duplicate that already exists in username_clean as the users table does not permit duplicates. Is there a SQL or PHP solution to append a suffix such as 1,2,3 etc after such a duplicate so that they do not exist in the users table? I could do this manually but as I want to run this routine many times this is not a solution. Many thanks in advance …

Member Avatar
Member Avatar
+0 forum 1

hi , i ma using the reporting service in MS SQL express 2008. but in the company i don't have the admin previlages to upload and create reports to the server. if i was to ask from the administrator to grant me the previlages what previlages does he have to give to me??? please reply thanks

Member Avatar
Member Avatar
+0 forum 8

The End.