10,940 Topics

Member Avatar for
Member Avatar for minghags

Hello! I have a problem with sorting mysql queries into pages. So i wanna set every query that is passed to screen to be divided with 30 rows per page. Here is what i come up with: <?php $con=mysqli_connect("*","*","*","*"); // MySQL connect if (mysqli_connect_errno()) { echo "MySQL: no connection! " …

Member Avatar for Adrian_5
0
448
Member Avatar for mexabet

I'm trying to prevent the user from purchasing any share, if the cash in his/her account is less than the desired stock cost (price * shares). However, I'm getting the following error: Warning: mysql_query() expects parameter 1 to be string, array given in /home/jharvard/vhosts/pset7/public/buy.php on line 39 Here is the …

Member Avatar for Adrian_5
0
319
Member Avatar for mexabet

My script has a two bugs, which I've been unable to fix. So, I need your help. Here is the file: <?php // configuration require("../includes/config.php"); // check if form was submitted if ($_SERVER["REQUEST_METHOD"] == "POST") { // type of transaction - for tracking history $transaction = 'SELL'; // validate submission …

Member Avatar for mexabet
0
308
Member Avatar for junaid_5

this is my code $totalDates = "SELECT COUNT( DISTINCT date ) FROM table_name"; $result = mysqli_query($connection, $totalDates); $totalDates = mysqli_fetch_array($totalDates, MYSQLI_NUM); echo "there are total $totalDates Distinct Rows"; i want to get the no of distinct dates from table_name but it giving me this error , what i might be …

Member Avatar for hericles
0
161
Member Avatar for dskanth

Hi, i have the requirement of converting a php-mysql app into a standalone app. The main purpose is to hide the source code from the client, and to run the app in his system without a web browser. I wonder if there is any tool for this, so that i …

Member Avatar for itisnot_me
0
2K
Member Avatar for gilgil2

Hi, I have started using file_get_contents and regex, and after struggling have got it working. The issue I have is that when I print_r($match[1]); I get the results I want, but I do not know how to then convert this into something that I can store in a MySql database, …

Member Avatar for Borzoi
0
143
Member Avatar for ankit1122

use people; SELECT 'first' UNION SELECT first from e where skills regexp "javapl" INTO OUTFILE '/home/ankit/csv/tablename.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n'; this runs without problem to /var/tmp folder but other folders gave error:13 can't write please help

Member Avatar for ankit1122
0
267
Member Avatar for jKidz

Hi Guys, I am developing a Music Database system. This is a 'Song.php' page. It will be a Detailed page of a each song. Ex : song.php?id=1 <?php if(!empty($_GET['id'])) { $sid = mysql_real_escape_string ($_GET['id']); } // if song id is null, user will redirect to the full song list else …

Member Avatar for Benjamin_11
0
178
Member Avatar for ryantroop

so.. Im having trouble wrapping my noodle around this... my initial thought: -- events create table Events ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Title VARCHAR(512) NOT NULL, Description TEXT NULL, StartDate DATETIME NOT NULL, EndDate DATETIME NULL ); create index StartDate_OnEvents On Events (StartDate); create table EventFrequency ( …

Member Avatar for ryantroop
0
1K
Member Avatar for [NOPE]FOREVER

I have a php/mysql project. When the admin deletes a customer or product from the database on the form I need an confirm box to show and ask the admin if they are sure they want to delete and have the customer row show in the confirm also. Here is …

Member Avatar for pritaeas
4
339
Member Avatar for centenond

So i made a inbox system and its stores the accents(í,é,ú etc..) like &iacute;,&eacute;,&uacute; wich is perfect, but then i made another script and its storing the í's like à and i dont know why... i have <meta charset="utf-8"> on both and mysql collation are both utf8 any one knows …

Member Avatar for centenond
0
118
Member Avatar for nadiam

hey guys, so i'm trying to insert data from one table to another. table 1: |event_id|event_name|start|end|event_venue| table 2: |guest_id|guest_name|event_id|event_name| $event = mysql_query("INSERT INTO event VALUES('','$name','$dstart $tstart','$dend $tend','$venue')"); $insertg = mysql_query("INSERT INTO guest(event_id, event_name) SELECT event_id, event_name, FROM `event` WHERE `event_name` = `$name` "); i get : > Column count doesn't …

Member Avatar for guruparthi
0
2K
Member Avatar for cdes1145

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\classes\Trade.class.php on line 12 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\classes\Trade.class.php on line 19 Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\classes\Trade.class.php on line 70 Line 12 [CODE]while ( $trade_users_row …

Member Avatar for guruparthi
0
660
Member Avatar for Aruna R

Happy Day.. Hello All! I want to know the Difference between mysql_fetch_array and mysql_fetch_assoc.,and Im new here.. and also to php.. Plz help me to solve my problems..

Member Avatar for guruparthi
0
7K
Member Avatar for gola420

Hi,im trying to insert into table student_acedamic_history but I get this error.Heres my code. CREATE TABLE Student_Acedamic_History( S_id INT, Degree_Title VARCHAR(30), Institue VARCHAR(30), Year_Of_Comp INT, Total_Marks INT, Obtained_Marks INT, PercentAge FLOAT, CONSTRAINT fk_S_id_students FOREIGN KEY student_acedamic_history(S_id)REFERENCES students (S_id)ON UPDATE CASCADE ON DELETE CASCADE ); And the data: INSERT INTO student_acedamic_history …

Member Avatar for hericles
0
217
Member Avatar for Stefce

Hello guys i have question how is the right way to write the mysqli_connect ? $con=mysqli_connect("username","host","password","db_name"); Please tell me if im wrong and how to fix it. Thanks ! :)

Member Avatar for cereal
0
131
Member Avatar for malatamil

i have 2 tables seo_footer_title and seo_title. i want to add title,description and keywords footer.php <li><a href="index.php?city=<? echo $city;?>">Home</a></li> <li><a href="about_us1.php?page=2" title="About Us" onclick="function changetab();">About Us</a></li> <li><a href="contact_us1.php?page=3" title="Contact Us">Contact Us</a></li> header.php $page = $_GET['page']; $sql1 = mysql_query("SELECT st.`id`,st.Catagory, st.`title`, st.`description`, st.`keywords`,sft.id,sft.titles FROM `seo_title` st JOIN seo_footer_title sft ON sft.id=st.Catagory …

Member Avatar for malatamil
0
232
Member Avatar for mattskills

Hi, i'm having some trouble with my MySQL server where i can't log in or connect to it from the terminal , phpmyadmin or my server control panel. the password is correct , i have reset it a number of times but still get the same message: ERROR 1045 (28000): …

Member Avatar for maba001
0
265
Member Avatar for nadiam

Hey guys, so im wondering if theres a way to insert 2 input values into one column in PDO? coz in mysql_* i just did something like this and it worked: INSERT INTO tablename VALUES ('input1 input 2', 'input3'); pdo i tried : $event = $dbh->prepare("INSERT INTO event(event_name,start_event,end_event,event_venue) VALUES('$name', CONCAT_WS('$dstart', …

Member Avatar for hericles
0
278
Member Avatar for AdriftUniform

Hi, I am trying to display two or more images from a database and I cannot get them to display simultaneously. I have a database table called 'tbl_images' which has two fields 'id' and 'image' here is the code for the database creation: [code=mysql] CREATE TABLE tbl_images ( id tinyint(3) …

Member Avatar for garyrichard
0
16K
Member Avatar for nevek

When I use `select indicator...`in my select statement below I can't use `$row[indicator]` when I use `select indicator as indicator` I can use `$row[indicator]`. Why is this? $stmt=$mysqli->prepare("select indicator as indicator, count(status)as 'ok', (select count(status) from viewindicatoren where status ='niet ok' and afdelingid=? group by IND_id ) as 'nietOk' from …

Member Avatar for nevek
0
167
Member Avatar for LRNPHP

Hi Everyone, I haven't started coding or anything but I need to know if it's possible to read a file from last read position? I want to read a file and dump the content into a MySQL database but don't want to read the entire file from start to end …

Member Avatar for LRNPHP
0
220
Member Avatar for [NOPE]FOREVER

I have a table that extracts data from a mysql database, I want the table to be centerd on the screen. I have used text-align: center; but obviously it only centers the text inside the div. here is my css .tableOuter { text-align: center; } .tableInner { text-align: center; margin-left: …

Member Avatar for [NOPE]FOREVER
7
7K
Member Avatar for [NOPE]FOREVER

I have a php/mysql project. When the admin deletes a customer from the database on the form I need the confirm box to display the customer row that they want to delete as well as the message. Here is current confirm box with a message <script type = text/javascript> function …

Member Avatar for hericles
7
508
Member Avatar for saadi06

Hi, I have a very complex query that is using mysql functions and complex logic. I have done indexing of important fields that needs to be done but I am having issue that the records keep on duplicating and I am using group by to remove this issue but my …

Member Avatar for veedeoo
0
107
Member Avatar for Syntax12

I want to show some mysql results in two different areas... I thought I would do two queries, and show a certain few (1-5) or whatever on one area, and the rest on another, however I need them split even.... how can I do this? I thought about doing something …

Member Avatar for zein1212
0
335
Member Avatar for mark.giles.14

I need to rebuild my website from scratch as its using old mysql script in pages and based on xmb forum software as a logon system and to connect to my sports database pages. Can someone suggest the best option from here to either update to mysqli or PDO. So …

Member Avatar for pritaeas
0
468
Member Avatar for My question

How do i write php code for getting field from mysql as dropdown in php, and, also to display the related records of selected option in dropdown from database

Member Avatar for fireburner29
0
416
Member Avatar for EJL242000

Hello, I am trying to create a table in MySQL with the following data: $sql = "CREATE TABLE $uID ( Col0 int(10) NOT NULL auto_increment, Col1 varchar(255) NOT NULL, Col2 varchar(255) NOT NULL, Col3 varchar(255) NOT NULL, PRIMARY KEY(Col0) )"; However, I keep getting a syntax error. Can someone pls. …

Member Avatar for cwarn23
0
442
Member Avatar for vishalonne

I have 2 drop down. In 2nd drop down items are added dynamically based on 1st drop down selection. Now I want selected value of 5th subject to store in MySQL table. I am not able to get the value of option which is selected in 2nd drop down. How …

Member Avatar for DJBirdi
0
293

The End.