MySQL Server

47K

Solutions

23K

Contributors

MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.

Share tech news, updates, or what's on your mind.

Sign up to Post

This login form does not open the intended page.  In only opens the error message in the retry.php page.

 Here is part of the code where the problem might be found.  Unfortunately, I do not see it.

<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
  $_SESSION['PrevUrl'] = $accesscheck;
//  session_register('PrevUrl');
}

if (isset($_POST['user'])) {
  $loginUsername=$_POST['id'];
  $password=md5($_POST['pw']);
  $MM_fldUserAuthorization = "access";
  $MM_redirectLoginSuccess = "index.php";
  $MM_redirectLoginFailed = "tryagain.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_ibtib_dbc, $ibtib_dbc);
        
  $LoginRS__query=sprintf("SELECT user, pw, access FROM users WHERE user='%s' AND pw='%s'",
  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
   
  $LoginRS = mysql_query($LoginRS__query, $ibtib_dbc) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
   
    $loginStrGroup  = mysql_result($LoginRS,0,'access');
   
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;           

    //register the session variables
//    session_register("MM_Username");
//    session_register("MM_UserGroup");

    if …
0
<?php
//Step1
 $db = mysqli_connect('localhost','username','','db_name')
 or die('Error connecting to MySQL server.');
?>

<html>
 <head>
 </head>
 <body>
 <h1>PHP connect to MySQL</h1>
 
<?php
//Step2
$query = "SELECT * FROM imabangalore";
mysqli_query($db, $query) or die('Error querying database.');
$result = mysqli_query($db, $query);
$row = mysqli_fetch_array($result);

while ($row = mysqli_fetch_array($result)) {
 echo $row['Name'] . ' ' . $row['IMA Memb No'] . ' ' . $row['Spouse Name'] . ' ' . '<br />';
}
mysqli_close($db);
?>

</body>

</html>

Open in new window


Results shows all the data, but I want only the searched Name and their details
0
Hi Experts;
I've had success at migrating a complex stored procedure from MS SQL to MYSQL but am stumped at a line using PARTITION OVER.

I can't figure out how to convert the following code:
MS SQL code:
                  SELECT *,
                        t.GId,
                        t.PId,
                        t.GABNum,
                        t.PTABNum,
                        t.paeid,
                        RowNumber = ROW_NUMBER()
                        OVER(PARTITION BY t.GId, t.PId, t.GABNum ORDER BY t.GABNum, t.PTABNum)

                  FROM
                        mydb.dbo.myTable t

The above is a derived table within a larger query and eventually I want MIN(t.paeid) and MAX(t.paeid)

I've commented out the partition line and am able to get matching results except for the MAX(t.paeid) which makes sense.

I've been trying several methods found on the internet, and so far I've gotten this far (to get the MIN value). However it returns 0 rows so I'm doing it wrong.
MYSQL code:

use mydb;
set @r = 0;
select
@r AS Firstpaeid
      FROM (SELECT *
                  FROM (SELECT @_gid = NULL, @_pid = NULL, @_gabnum = NULL) vars,
                        mydb.myTable
                  ORDER BY GId, PId, GABNum)
        WHERE (CASE WHEN @_gid <> GId AND @_pid <> PId AND GABNum <> @_gabnum THEN
                  @r := paeid END)
                            AND (@_gid = GId)
                            AND (@_pid = PId)
                            AND (@_gabnum := GABNum)

Perhaps I should be using a different method entirely? I've read about CONCAT(GROUP BY...) and am trying that method now.
I also haven't worked with Partitions in SQL (or MYSQL) so …
0
I have a pagination that load more when I click on the load more button, which I got from the below URL http://makitweb.com/load-more-results-with-jqueryajax-and-php/

Whenever I add RAND() it always duplicates the value.

index.php

<?php

$rowperpage = 10;

$allcount_query = "SELECT count(*) as allcount FROM users order by id";
$allcount_result = mysql_query($allcount_query);
$allcount_fetch = mysql_fetch_array($allcount_result);
 $allcount = $allcount_fetch['allcount'];

$query = "select * from users order by RAND(" . date("Ymd") . ") asc limit 0,$rowperpage ";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
?>

<div><h1><?php echo $row['id']; ?></div>

<?php
}
?>

<h1 class="load-more">Load More</h1>
<input type="hidden" id="row" value="0">
<input type="hidden" id="all" value="<?php echo $allcount; ?>">

Open in new window


getData.php

<?php
$row = $_POST['row'];
$rowperpage = 10;


$query = 'SELECT * FROM users ORDER BY id limit '.$row.','.$rowperpage;
$result = mysql_query($query);

$html = '';
while($row = mysql_fetch_array($result)){

$html .= '<div><h1>'.$id.'</h1></div>';

}
?>

Open in new window

0
I've read a few tutorials online for sending a blank image in an html email in order to log when the email is opened, but none of them seem to work in my system.  I don't need anymore information than the date/time an email was opened to log in my MySQL database.  Any help would be appreciated!
0
HI All, trying to figure out how to use data from two tables in Domo.

This is what I'm trying and it is not working.

SELECT id, jobsite, status FROM application UNION SELECT client, id, nickname FROM jobsites

Open in new window


It's only showing the first part, however I do not get any errors.

Any help is greatly appreciated.
0
I have the following query on table fila

SELECT * 
FROM fila f
JOIN meta m
ON m.link = f.idlinks
WHERE m.meta2 < m.meta

Open in new window

It works, but I need something more ...
I need the query to get into the FILA table values that are no longer in the activity table, for example:
If the activity table already exists in the URL column and in the ACAO column, that data is disregarded and I get the next item in the row table

Example:
Table Fila
Table fila
Table Atividade

atividade2.pngAs already exists in the activity table at URL 976 and USER 92, that record has to be disregarded and the query move to the next record in the FILA table
0
We are looking at deploying SuiteCRM Company wide.  We have a development environment which we are testing all the required features and modules that we will required, and at the same time demoing to the management teams what the system will eventually look like.

We have a problem in that at current we have around 6 different websites/microsites that are hosted and designed by 6 different companies (all sadly managed by our marketing department, hence 6 companies!)

At current the contact form comes in to an email address (webenquires@) and then gets routed via our ancient mailserver.

We will be migrating to office 365 the same time as we roll out the new CRM.

I am looking for a solution to automatically create a lead from an inbound email in SuiteCRM.
Yes I am aware of doing it via campaigns and forms, however trying to get all 6 companies to make the correct changes at go live the same time will fail.  

Also we need to demo this system for a few weeks to various management teams, and would like to implement the form changes 1 site and company at a time allowing for problems.

What I need is a temporary solution to do this via:

Either MySQL or inner Join
PHP coding
Or some kind of workflow

The correct inbound email address (webenquiries) is already configured and working in SuiteCRM.

I tried the following inner join from the example above which is based on Sugar CE6.5 failed.  I modified it to work with SuiteCRM and it now generates a Lead, …
0
I am using jxDatePicker to accept date data in my java project but MySql is not recognizing it as Date despite setting the Table Data as DATE and formatting the jxDatePicker value to "yyyy-mm-dd" format in the code.
I will appreciate your help to fix this problem.
0
Dim ds As DataSet = dbc.data("CALL sv_Int_months_final1 ();")
0
How do I move MySql database to new server?
0
I have a username and password for the real estates agent theysaid I have to call the web service and get a response but
How can I integrate to my theme in wordpress if u want to help me will be good or I can hire you too but I like to learn anny I wait for your answer guys thank you
0
I am connecting to MySQL server using mysql command line utility.  Server version: 10.2.6-MariaDB-log.  

I am loosing connection after about 10 min executing my stored procedure.  Stored procedure created a cursor, iterates it, and does something.  It is not stuck at the time connection is lost.  What setting is causing this?  How can this timeout be increased?

Please note, I am not running my stored procedure in MySQL Workbench.
0
After executing two seperate 'WITH' statements, I can show them seperately and they will show the correct data.
However, there seems to be no way to combine the two results in one table to the user.

UNION gives you a timeout.
You cant seem to create a temporary table to append to, because the recursive WITH seems to not allow this.

WITH recursive temp as (
   SELECT current_template, current_iteration, parent_template, parent_iteration, tkey, val
   FROM templatevalues
   WHERE tkey='linnumber' AND val='1' AND guid='ffb7e0cd-5dff-4b83-be88-ebf66d5557be' -- this is the starting point
   UNION ALL
   SELECT c.current_template, c.current_iteration, c.parent_template, c.parent_iteration, c.tkey, c.val
   FROM templatevalues c
   JOIN temp p ON p.parent_template = c.current_template AND p.parent_iteration = c.current_iteration AND guid='ffb7e0cd-5dff-4b83-be88-ebf66d5557be' -- this is the recursion
),
temp2 as (
   SELECT current_template, current_iteration, parent_template, parent_iteration, tkey, val
   FROM templatevalues
   WHERE tkey='linnumber' AND val='1' AND guid='ffb7e0cd-5dff-4b83-be88-ebf66d5557be' -- this is the starting point
   UNION ALL
   SELECT c.current_template, c.current_iteration, c.parent_template, c.parent_iteration, c.tkey, c.val
   FROM templatevalues c
   JOIN temp2 p ON c.parent_template = p.current_template AND c.parent_iteration = p.current_iteration AND guid='ffb7e0cd-5dff-4b83-be88-ebf66d5557be' -- this is the recursion
)
0
Looking for advice on moving forward or the actual steps.

Current SETUP:  Windows Server 2008R2 Failover Cluster with 2 Physical Nodes and 1 Physical SAN
Future SETUP:  Windows Server 2016 Failover Cluster with 2 Virtual Nodes and 1 SMB3 FileServer with the Database.

This is a small db only 60GB running MySQL5.6

My Questions is my future setup the best idea?  I want to move them away from physical and goto virtual and at the same time install new 2016 Servers.  It looks like in the past (I wasn't here) they just built a MS Win2k8 Cluster and then installed the MySQL service and let Windows manage that.  When I goto MYSQL now it has cluster version and enterprise and 7.5!  So which setup is best?

I would perfer Windows Server 2016 and virtual solutions.  Does anyone know which is best setup for small 60GB database with Frontend Tomcat application and what are the steps to setup?  Is it the same as standup the cluster and then install the MySQL standalone service?  

Thank you for your time and help.
The current setup seems like this:
http://www.clusterdb.com/mysql/mysql-with-windows-server-2008-r2-failover-clustering
0
Hi,

I have a table of data that looks like the following

Storage_Container Folder DataField1 DataField2
----–---------—–------------------
Storage1, Folder1, Data1, Data2...
Storage2,Folder1,Data1,Data2...
Storage3,Folder1,Data1,Data2...

So from above I need to make sure that all the data field columns DataField1 and DataField2 have an entry for each storage_container above as well as for each Folder.
Also note that the data fields match as well.

I don't know if this is possible but is there some MS T-SQL to perform this type of validation.
I
Thanks Ward
0
my database using Xampp control panel for mysql using phpmyadmin tool. so how do i install my database over microsoft azure cloud?
0
please provide the php code with mysql query to hide the message in an image using steganography
0
I need a wocommece query which can return the following:

Product ID, Product Name, Product URL, Url of Featured Image,
where wp_postmeta.meta_key = _wc_dispatch_days and wp_postmeta.meta_value > 0
and
stock level > 0


the meta key _wc_dispatch_days is a custom key, and it hold values, for which i need records with values >0
0
Hello Experts,

How would I insert an array of data into a MySQL database, using PHP? I am able to successfully enter one row of data into each table (renters and rental_agreement), but I get confused when a renter rents more than one car seat. How do I in essence duplicate all of the necessary information into the rental_agreement table, but have the serial_number change to the next number in the series of seats rented?

Attached are three images depicting two tables and one example entry from my database.

Rental Agreement Structure
Renters Structure
Rental Agreement Example
I have the following code which inserts data into the renters table. The last_id is then inserted into the rental_agreement table. For the time being, I am using test data and not the $_POST data:

$first_name="HOMER";
$last_name="SIMPSON";
$dl="S123-456-54-367-1";
$dl_street="123 SESAME STREET";
$dl_unit=" ";
$dl_city="I-DON'T-KNOW";
$dl_state="KENTUCKY";
$dl_zip="12345";
$current_street="123 SESAME STREET";
$current_unit=" ";
$current_city="I-DON'T-KNOW";
$current_state="KENTUCKY";
$current_zip="12345";
$phone="1234567891";
$email="test@yahoo.com";

$sql = 'INSERT INTO `renters` 
(renters_first_name, renters_last_name, 
renters_dl_number, renters_dl_street, renters_dl_unit, renters_dl_city, renters_dl_state, renters_dl_zip,
renters_current_street, renters_current_unit, renters_current_city, renters_current_state, renters_current_zip,
renters_phone, renters_email)
 VALUES ("' . 

Open in new window

0
Hi,

I am trying to create a batch file which executes a query on HeidiSQL.

I created a text file containing the piece of SQL which updates a table in the database. The batch job (attached as test.txt) was then created and be scheduled to run on the first of every month.

If I run test.txt  I get an error which I have also attached as BATCHERROR.png.

I am fairly new to HeidiSQL and batch jobs so spent most of my time on google trying to find a solution.

Thanks
batcherror.PNG
test.txt
0
Hello Experts,

Perhaps, I am going about this incorrectly. I am open to ideas on how to do this.

I have a PHP program that generates a PDF file, dynamically using FPDF. Once the user clicks the submit button, at run time, I need to be able to do the following nearly simultaneously:
Save the PDF file in a specified location;
Grab the freshly generated PDF;
Attach it to an email; and
Send the email to specified users.

First, is this even possible?

I was thinking about using PHP Mailer in combination with FPDF.

Any ideas?
0
I'm receiving this error when I run the program...

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables

The array has 50 items.
My array item is $_REQUEST['itemslist'].

//I'm setting up the query types with this.
$queryTypes = array_fill(0,count($_REQUEST['itemslist']),'s');

//Building the question marks here.
$questionMarks = array_fill(0,count($_REQUEST['itemslist']),'?');

//Merging the query types with the itemslist.
$params = array_merge($queryTypes, $_REQUEST['itemslist']);

//My query
if($grabStuff = $mysqli->prepare("SELECT var1, var2, var3, var4 FROM my_table where id in (" . $param . ")"))
{
call_user_func_array(array($grabStuff, 'bind_param'), refValues($params));      
$grabStuff->execute();
}


//The function
function refValues($arr)
{
$refs = array();
foreach($arr as $key => $value)
      $refs[$key] = &$arr[$key];
return $refs;
}

When I print the array...it shows all 50 items.
When I print the params (with an s) I get 100 items.
I'm using php 7.

Thanks!
0
I am trying to install wordpress on my Raspberry Pi. I can install apache2 and php without a problem
When I try and install MySQL I dont get asked to change the Password after the install
Also when I try to install php5-mysql I get an error saying dependency is missing

How do I fix this so I can continue the Wordpress install
0
Hi there,
I need to create a website for a charity and am looking for suggestions on existing frameworks to use.  The system should
support  users to register and login through a web portal.  

The basic operations is that the admin will add a list of activities in a main List.  A user can check-out these activities from the main list or the admin can assign an activity to a member.

1. User registration mechanism
2. Admin dashboard/user dashboard

I am looking for a PHP/Javascript - MySQL based system.  Can you suggest any frameworks that I can customize easily.
Thank you
0

MySQL Server

47K

Solutions

23K

Contributors

MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.