$link function is giving “Uncaught Error: Call to undefined function mysql_connect() in – what is causing the error?

using post to send data from an html form to a mysql database using php. there is an error when connecting to the database.

I tried to rewrite a couple of different ways.

$  link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if (!$  link) {     die('Could not connect: ' . mysql_error()); }

The code above should not produce an error when connecting to the database.

updated os to mojave 10.14.5, now lsof is giving me errors with stat

I had a system update last Thursday and ever since I have been getting the errors below. I have tried reinstalling lsof via homebrew, upgrading bash, rebooting, but no luck. How do I even go about debugging this issue.

$   lsof -i lsof: WARNING: can't stat() apfs file system /       Output information may be incomplete.       assuming "dev=1000004" from mount table lsof: WARNING: can't stat() devfs file system /dev       Output information may be incomplete.       assuming "dev=396eef60" from mount table lsof: too many (> 32) symbolic links in readlink() path: devfs lsof: WARNING: can't stat() apfs file system /private/var/vm       Output information may be incomplete.       assuming "dev=1000006" from mount table lsof: WARNING: can't stat() autofs file system /net       Output information may be incomplete.       assuming "dev=32000001" from mount table lsof: too many (> 32) symbolic links in readlink() path: map -hosts lsof: WARNING: can't stat() autofs file system /home       Output information may be incomplete.       assuming "dev=32000002" from mount table 

Google Cloud DNS giving 404 on top level domain

I’m using Google Cloud DNS and Google App Engine Standard to configure an application.

Currently, I configured the DNS like this

mydomain.com.   A   300  216.239.32.21 216.239.34.21 216.239.36.21 216.239.38.21  mydomain.com.   AAAA    300  2001:4860:4802:32::15 2001:4860:4802:34::15 2001:4860:4802:36::15 2001:4860:4802:38::15  mydomain.com.   MX  216000   1 aspmx.l.google.com. 5 alt1.aspmx.l.google.com. 5 alt2.aspmx.l.google.com. 10 alt3.aspmx.l.google.com. 10 alt4.aspmx.l.google.com.  mydomain.com.   NS  21600    ns-cloud-c1.googledomains.com. ns-cloud-c2.googledomains.com. ns-cloud-c3.googledomains.com. ns-cloud-c4.googledomains.com.  mydomain.com.   SOA 21600    ns-cloud-c1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 3600 259200 300  @.mydomain.com. A   300  216.239.32.21 216.239.34.21 216.239.36.21 216.239.38.21  api.mydomain.com.   CNAME   300  ghs.googlehosted.com.  stage.mydomain.com. CNAME   300  ghs.googlehosted.com.  api.stage.mydomain.com. CNAME   300  ghs.googlehosted.com.  www.stage.mydomain.com. CNAME   300  ghs.googlehosted.com.  www.mydomain.com.   CNAME   300  ghs.googlehosted.com. 

So that I configured an stage environment using these domains and it is working so far.

  • api.stage.mydomain.com
  • stage.mydomain.com / www.stage.mydomain.com

I recently added the configuration for production with these domains

  • api.mydomain.com
  • mydomain.com / www.mydomain.com

And it is working so far except that mydomain.com is returning 404 http status from Google:

404. That’s an error.  The requested URL was not found on this server. That’s all we know. 

Does anyone has encountered this problem before? How can it be solved so that mydomain.com starts working?

Turtle bgpic() not displaying image and giving me these error messages…?

I am trying to get Turtle to display a background image. Here’s my code:

import turtle from turtle import * from appJar import gui ... turtle.setup(900,700)       #windowsize Ian = turtle.Turtle() Ian.hideturtle() Ian.screen.title("Arp Convertor") Ian.screen.bgcolor("#4a4a54")            Ian.screen.bgpic('Backwslots2.gif') Ian.speed(0) Ian.penup()                             #dont draw Ian.goto(-430,250)                      #where we'll start drawing 

My image is the right size, exactly 900×700 in the current dir (same as my .py file). But the bgpic() line is giving me these errors.

> Exception in Tkinter callback Traceback (most recent call last):   > File > "C:\Users\Ian\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", > line 1705, in __call__ >     return self.func(*args)   File "D:\Midipy\appJar\appjar.py", line 3574, in <lambda> >     return lambda *args: funcName(param)   File "midipy.py", line 21, in openthefile >     convertthefile(btn)   File "midipy.py", line 141, in convertthefile >     Ian.screen.bgpic('Backwslots2.gif')   File "C:\Users\Ian\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", > line 1482, in bgpic >     self._setbgpic(self._bgpic, self._bgpics[picname])   File "C:\Users\Ian\AppData\Local\Programs\Python\Python37-32\lib\turtle.py", > line 738, in _setbgpic >     self.cv.itemconfig(item, image=image) 

Similar python list is giving different print layout

This is from Udacity’s Algorithm course and it was about graph DFS representation.

# answer code     def dfs_helper(self, start_node):         ret_list = [start_node.value]         start_node.visited = True         edges_out = [e for e in start_node.edges                      if e.node_to.value != start_node.value]         for edge in edges_out:             if not edge.node_to.visited:                 ret_list.extend(self.dfs_helper(edge.node_to))         return ret_list # printed: ['London', 'Shanghai', 'Mountain View', 'San Francisco', 'Berlin', 'Sao Paolo'] 
# my modify     def dfs_helper(self, start_node):         ret_list = [start_node.value]         # Your code here         start_node.visited = True         edges_out = [e for e in start_node.edges if not e.node_to.visited] # only difference         for e in edges_out:             ret_list.extend(self.dfs_helper(e.node_to))         return ret_list # printed: # [ 'London', #  'Shanghai', #  'Mountain View', #  'San Francisco', #  'Berlin', #  'Sao Paolo', #  'San Francisco', #  'Berlin', #  'Sao Paolo'] 

It seems so weird, so I even checked it’s data type and if I could access it with index, but everything was fine, but I still have no idea why the printed result is formated differently.

MyLead – a global affiliate network – WE GIVING BONUSES – YOU WILL EARN MORE

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Let’s start, with a handshake

MyLead is a comprehensive platform for earning money online that provides you with a lot of tools that will allow you to do it in a simple way. We are a global affiliate network tested by tens of thousands of publishers, who have paid millions of dollars, making a smile on their faces.

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Earn with us modern roads

Almost 1000 affiliate programs – such a huge number is at your disposal. Dozens of different categories, the most popular campaigns, and tested affiliate programs – this is the MyLead offer that you can use at any time.

We also offer over 20 different smartlinks, thanks to which you can monetize your traffic from around the world.

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Speed of light? Were faster!

30 days? 15 days? NO! You will receive your money most often in only 48 hours!

You can get your money to your bank account or one of 7 internet payment systems. You decide how you like to receive your pay. We always choose modern solutions.

In addition, only $ 20 is enough to withdraw your money.

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Knowledge for free for you!

We understand that you may need advice at all times. We are not sleeping with you – we are available 24/7. You can contact us through a huge range of roads, including the Discord server.

We know that sometimes you need help in earning money. You can count on our mentors who will give you a helping hand and help you earn money. In addition, we have dozens of blog articles for you that will present you with effective ways to profit.

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Are we crazy? Were giving away bonuses!

As you can see – we give you a lot, but because your presence on MyLead is very important to us, we also have exclusive bonuses for you, thanks to which we will pay you more for every customer you get! Take advantage of them now!

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Thousands of people can not be wrong!

Already over 25,000 people have set up their accounts on MyLead. Our best publisher has made over $ 150,000 with us. We hope you will become the next of them.

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

We have something else for you!

This is not the end of the attractions! We have exclusive training for you that will present you with the most important information about making money online and show you how to generate a profit. Your access to the training is completely free.

MyLead   a global affiliate network   WE GIVING BONUSES   YOU WILL EARN MORE

Giving role based on role ID

I am trying to give roles based on the ID of the role to users in a guild once they join however, cannot seem to get it to give when I provide the role ID and I can when I provide the role name.

I’ve tried both

@Nao.event async def on_member_join(member):     database = mysql.connector.connect(         host='localhost',         user='root',         passwd='',         database='Nao'     )     cursor = database.cursor()     query = "SELECT role FROM autorole WHERE server = %s"     values = (member.guild.id,)     cursor.execute(query, values)     result = cursor.fetchall()     for role in result:         role = discord.utils.get(member.guild.roles, name='Members')         await member.add_roles(role) 

Which works and

@Nao.event async def on_member_join(member):     database = mysql.connector.connect(         host='localhost',         user='root',         passwd='',         database='Nao'     )     cursor = database.cursor()     query = "SELECT role FROM autorole WHERE server = %s"     values = (member.guild.id,)     cursor.execute(query, values)     result = cursor.fetchall()     for role in result:         role = discord.utils.get(member.guild.roles, id=role[0])         await member.add_roles(role) 

which does not work.